}
99 99
         });
100 100
     }
@@ -104,8 +104,8 @@ public class SessionActivity extends BaseActivity implements SessionContract.Ses
104 104
         runOnUiThread(new Runnable() {
105 105
             @Override
106 106
             public void run() {
107
-                photosRecyclerView.setVisibility(View.GONE);
108
-                noPhotoLayout.setVisibility(View.VISIBLE);
107
+                photosRecyclerView.setVisibility(android.view.View.GONE);
108
+                noPhotoLayout.setVisibility(android.view.View.VISIBLE);
109 109
             }
110 110
         });
111 111
     }
@@ -120,4 +120,9 @@ public class SessionActivity extends BaseActivity implements SessionContract.Ses
120 120
         }
121 121
 
122 122
     }
123
+
124
+    @Override
125
+    public void setPresenter(SessionContract.Presenter presenter) {
126
+
127
+    }
123 128
 }

+ 4 - 3
app/src/main/java/ai/pai/lensman/session/SessionContract.java

@@ -1,5 +1,7 @@
1 1
 package ai.pai.lensman.session;
2 2
 
3
+import ai.pai.lensman.base.BasePresenter;
4
+import ai.pai.lensman.base.BaseView;
3 5
 import ai.pai.lensman.bean.PhotoBean;
4 6
 
5 7
 /**
@@ -7,14 +9,13 @@ import ai.pai.lensman.bean.PhotoBean;
7 9
  */
8 10
 public class SessionContract {
9 11
 
10
-    interface SessionView{
12
+    interface View extends BaseView<Presenter>{
11 13
         void addNewPhoto(PhotoBean bean);
12 14
         void showPhotoRecyclerView();
13 15
         void showEmptyView();
14 16
     }
15 17
 
16
-    interface SessionPresenter{
17
-        void start();
18
+    interface Presenter extends BasePresenter{
18 19
         void stop();
19 20
     }
20 21
 }

+ 3 - 3
app/src/main/java/ai/pai/lensman/session/SessionPresenterImpl.java

@@ -6,14 +6,14 @@ import java.util.ArrayList;
6 6
 
7 7
 import ai.pai.lensman.bean.PhotoBean;
8 8
 
9
-public class SessionPresenterImpl implements SessionContract.SessionPresenter ,SessionInteractor.SessionListener{
9
+public class SessionPresenterImpl implements SessionContract.Presenter,SessionInteractor.SessionListener{
10 10
 
11 11
     private Context context;
12 12
     private SessionInteractor interactor;
13 13
     private ArrayList<PhotoBean> photoList;
14
-    private SessionContract.SessionView sessionView;
14
+    private SessionContract.View sessionView;
15 15
 
16
-    public SessionPresenterImpl(Context context,String sessionId, SessionContract.SessionView view){
16
+    public SessionPresenterImpl(Context context,String sessionId, SessionContract.View view){
17 17
         this.context = context;
18 18
         this.sessionView = view;
19 19
         photoList = new ArrayList<>();

+ 12 - 8
app/src/main/java/ai/pai/lensman/upload/UploadActivity.java

@@ -5,7 +5,6 @@ import android.os.Bundle;
5 5
 import android.support.v7.widget.GridLayoutManager;
6 6
 import android.support.v7.widget.LinearLayoutManager;
7 7
 import android.support.v7.widget.RecyclerView;
8
-import android.view.View;
9 8
 import android.widget.ImageView;
10 9
 import android.widget.TextView;
11 10
 
@@ -19,14 +18,15 @@ import butterknife.BindView;
19 18
 import butterknife.ButterKnife;
20 19
 import butterknife.OnClick;
21 20
 
22
-public class UploadActivity extends BaseActivity implements UploadContract.UploadView{
21
+public class UploadActivity extends BaseActivity implements UploadContract.View {
23 22
 
24 23
     @BindView(R.id.tv_bt_status) TextView btStatusTextView;
25 24
     @BindView(R.id.iv_bt_status) ImageView btStatusImageView;
26
-    @BindView(R.id.icon_no_data) View noDataLayout;
25
+    @BindView(R.id.icon_no_data)
26
+    android.view.View noDataLayout;
27 27
     @BindView(R.id.recycler_view_sessions) RecyclerView sessionsRecyclerView;
28 28
     private SessionRecyclerAdapter adapter;
29
-    private UploadContract.UploadPresenter presenter;
29
+    private UploadContract.Presenter presenter;
30 30
 
31 31
     @Override
32 32
     protected void onCreate(Bundle savedInstanceState) {
@@ -102,8 +102,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.Uploa
102 102
         runOnUiThread(new Runnable() {
103 103
             @Override
104 104
             public void run() {
105
-                sessionsRecyclerView.setVisibility(View.GONE);
106
-                noDataLayout.setVisibility(View.VISIBLE);
105
+                sessionsRecyclerView.setVisibility(android.view.View.GONE);
106
+                noDataLayout.setVisibility(android.view.View.VISIBLE);
107 107
             }
108 108
         });
109 109
 
@@ -114,8 +114,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.Uploa
114 114
         runOnUiThread(new Runnable() {
115 115
             @Override
116 116
             public void run() {
117
-                noDataLayout.setVisibility(View.GONE);
118
-                sessionsRecyclerView.setVisibility(View.VISIBLE);
117
+                noDataLayout.setVisibility(android.view.View.GONE);
118
+                sessionsRecyclerView.setVisibility(android.view.View.VISIBLE);
119 119
             }
120 120
         });
121 121
 
@@ -137,4 +137,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.Uploa
137 137
         });
138 138
     }
139 139
 
140
+    @Override
141
+    public void setPresenter(UploadContract.Presenter presenter) {
142
+
143
+    }
140 144
 }

+ 4 - 3
app/src/main/java/ai/pai/lensman/upload/UploadContract.java

@@ -2,6 +2,8 @@ package ai.pai.lensman.upload;
2 2
 
3 3
 import java.util.ArrayList;
4 4
 
5
+import ai.pai.lensman.base.BasePresenter;
6
+import ai.pai.lensman.base.BaseView;
5 7
 import ai.pai.lensman.bean.SessionBean;
6 8
 
7 9
 /**
@@ -9,7 +11,7 @@ import ai.pai.lensman.bean.SessionBean;
9 11
  */
10 12
 public class UploadContract {
11 13
 
12
-    interface UploadView{
14
+    interface View extends BaseView<Presenter> {
13 15
 
14 16
         void addNewSessionView(SessionBean bean);
15 17
         void showBTDisconnectedView();
@@ -21,10 +23,9 @@ public class UploadContract {
21 23
 
22 24
     }
23 25
 
24
-    interface UploadPresenter{
26
+    interface Presenter extends BasePresenter{
25 27
 
26 28
         void checkBTStatus();
27
-        void start();
28 29
         void stop();
29 30
         void jumpToBriefs();
30 31
         void jumpToNewSession();

+ 3 - 3
app/src/main/java/ai/pai/lensman/upload/UploadPresenterImpl.java

@@ -8,14 +8,14 @@ import java.util.ArrayList;
8 8
 import ai.pai.lensman.bean.SessionBean;
9 9
 import ai.pai.lensman.session.SessionActivity;
10 10
 
11
-public class UploadPresenterImpl implements UploadContract.UploadPresenter {
11
+public class UploadPresenterImpl implements UploadContract.Presenter {
12 12
 
13 13
     private Activity activity;
14
-    private UploadContract.UploadView uploadView;
14
+    private UploadContract.View uploadView;
15 15
     private ArrayList<SessionBean> sessionList;
16 16
 
17 17
     private int seq = 0;
18
-    public UploadPresenterImpl(Activity activity,UploadContract.UploadView view){
18
+    public UploadPresenterImpl(Activity activity,UploadContract.View view){
19 19
         this.activity = activity;
20 20
         this.uploadView = view;
21 21
         sessionList = new ArrayList<>();

+ 104 - 97
app/src/main/res/layout/activity_login.xml

@@ -1,110 +1,117 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:layout_width="match_parent"
4
-    android:layout_height="match_parent"
5 3
     xmlns:progress="http://schemas.android.com/apk/res-auto"
6
-    android:background="@color/login_bg_blue">
7
-
8
-    <ImageView
9
-        android:id="@+id/iv_login_logo"
10
-        android:layout_width="128dp"
11
-        android:layout_height="128dp"
12
-        android:layout_centerHorizontal="true"
13
-        android:layout_marginTop="32dp"
14
-        android:src="@drawable/logo" />
15
-
16
-    <LinearLayout
17
-        android:id="@+id/layout_login_edit"
18
-        android:layout_width="290dp"
19
-        android:layout_height="96dp"
20
-        android:layout_below="@id/iv_login_logo"
21
-        android:layout_centerHorizontal="true"
22
-        android:layout_marginTop="16dp"
23
-        android:background="@drawable/login_rounded_rect_bg"
24
-        android:orientation="vertical"
25
-        android:paddingLeft="10dp"
26
-        android:paddingRight="10dp">
27
-
28
-        <RelativeLayout
29
-            android:layout_width="match_parent"
30
-            android:layout_height="0dp"
31
-            android:layout_weight="1">
32
-
33
-            <ImageView
34
-                android:id="@+id/iv_login_user_avatar"
35
-                android:layout_width="28dp"
36
-                android:layout_height="28dp"
37
-                android:layout_centerVertical="true"
38
-                android:src="@drawable/user_avatar" />
39
-
40
-            <EditText
41
-                android:id="@+id/et_login_user_name"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="match_parent">
6
+
7
+    <RelativeLayout
8
+        android:layout_width="match_parent"
9
+        android:layout_height="match_parent"
10
+        android:background="@color/login_bg_blue">
11
+
12
+        <ImageView
13
+            android:id="@+id/iv_login_logo"
14
+            android:layout_width="128dp"
15
+            android:layout_height="128dp"
16
+            android:layout_centerHorizontal="true"
17
+            android:layout_marginTop="32dp"
18
+            android:src="@drawable/logo" />
19
+
20
+        <LinearLayout
21
+            android:id="@+id/layout_login_edit"
22
+            android:layout_width="290dp"
23
+            android:layout_height="96dp"
24
+            android:layout_below="@id/iv_login_logo"
25
+            android:layout_centerHorizontal="true"
26
+            android:layout_marginTop="16dp"
27
+            android:background="@drawable/login_rounded_rect_bg"
28
+            android:orientation="vertical"
29
+            android:paddingLeft="10dp"
30
+            android:paddingRight="10dp">
31
+
32
+            <RelativeLayout
42 33
                 android:layout_width="match_parent"
43
-                android:layout_height="match_parent"
44
-                android:layout_marginLeft="12dp"
45
-                android:layout_toRightOf="@+id/iv_login_user_avatar"
46
-                android:background="@color/white"
47
-                android:gravity="center_vertical"
48
-                android:hint="@string/account_name"
49
-                android:textColor="@color/dark_grey"
50
-                android:textColorHint="@color/text_hint_grey_color"
51
-                android:textSize="16sp" />
52
-
53
-
54
-        </RelativeLayout>
55
-
56
-        <View
57
-            android:layout_width="match_parent"
58
-            android:layout_height="1px"
59
-            android:background="@color/line_bg"/>
60
-        <RelativeLayout
61
-            android:layout_width="match_parent"
62
-            android:layout_height="0dp"
63
-            android:layout_weight="1">
64
-
65
-            <ImageView
66
-                android:id="@+id/iv_login_pwd"
67
-                android:layout_width="28dp"
68
-                android:layout_height="28dp"
69
-                android:layout_centerVertical="true"
70
-                android:src="@drawable/password" />
71
-
72
-            <EditText
73
-                android:id="@+id/et_login_pwd"
34
+                android:layout_height="0dp"
35
+                android:layout_weight="1">
36
+
37
+                <ImageView
38
+                    android:id="@+id/iv_login_user_avatar"
39
+                    android:layout_width="28dp"
40
+                    android:layout_height="28dp"
41
+                    android:layout_centerVertical="true"
42
+                    android:src="@drawable/user_avatar" />
43
+
44
+                <EditText
45
+                    android:id="@+id/et_login_user_name"
46
+                    android:layout_width="match_parent"
47
+                    android:layout_height="match_parent"
48
+                    android:layout_marginLeft="12dp"
49
+                    android:layout_toRightOf="@+id/iv_login_user_avatar"
50
+                    android:background="@color/white"
51
+                    android:gravity="center_vertical"
52
+                    android:hint="@string/account_name"
53
+                    android:textColor="@color/dark_grey"
54
+                    android:textColorHint="@color/text_hint_grey_color"
55
+                    android:textSize="16sp" />
56
+
57
+
58
+            </RelativeLayout>
59
+
60
+            <View
61
+                android:layout_width="match_parent"
62
+                android:layout_height="1px"
63
+                android:background="@color/line_bg" />
64
+
65
+            <RelativeLayout
74 66
                 android:layout_width="match_parent"
75
-                android:layout_height="match_parent"
76
-                android:layout_marginLeft="12dp"
77
-                android:layout_toRightOf="@+id/iv_login_pwd"
78
-                android:background="@color/white"
79
-                android:gravity="center_vertical"
80
-                android:hint="@string/password"
81
-                android:inputType="textPassword"
82
-                android:textColor="@color/dark_grey"
83
-                android:textColorHint="@color/text_hint_grey_color"
84
-                android:textSize="16sp" />
85
-
86
-        </RelativeLayout>
87
-    </LinearLayout>
88
-
89
-    <Button
90
-        android:id="@+id/btn_login"
91
-        android:layout_width="290dp"
92
-        android:layout_height="48dp"
93
-        android:layout_below="@id/layout_login_edit"
94
-        android:layout_centerHorizontal="true"
95
-        android:layout_marginTop="15dp"
96
-        android:background="@drawable/login_btn_rounded_rect_bg"
97
-        android:gravity="center"
98
-        android:text="@string/login"
99
-        android:textColor="@color/white"
100
-        android:textSize="18sp" />
67
+                android:layout_height="0dp"
68
+                android:layout_weight="1">
69
+
70
+                <ImageView
71
+                    android:id="@+id/iv_login_pwd"
72
+                    android:layout_width="28dp"
73
+                    android:layout_height="28dp"
74
+                    android:layout_centerVertical="true"
75
+                    android:src="@drawable/password" />
76
+
77
+                <EditText
78
+                    android:id="@+id/et_login_pwd"
79
+                    android:layout_width="match_parent"
80
+                    android:layout_height="match_parent"
81
+                    android:layout_marginLeft="12dp"
82
+                    android:layout_toRightOf="@+id/iv_login_pwd"
83
+                    android:background="@color/white"
84
+                    android:gravity="center_vertical"
85
+                    android:hint="@string/password"
86
+                    android:inputType="textPassword"
87
+                    android:textColor="@color/dark_grey"
88
+                    android:textColorHint="@color/text_hint_grey_color"
89
+                    android:textSize="16sp" />
90
+
91
+            </RelativeLayout>
92
+        </LinearLayout>
93
+
94
+        <Button
95
+            android:id="@+id/btn_login"
96
+            android:layout_width="290dp"
97
+            android:layout_height="48dp"
98
+            android:layout_below="@id/layout_login_edit"
99
+            android:layout_centerHorizontal="true"
100
+            android:layout_marginTop="15dp"
101
+            android:background="@drawable/login_btn_rounded_rect_bg"
102
+            android:gravity="center"
103
+            android:text="@string/login"
104
+            android:textColor="@color/white"
105
+            android:textSize="18sp" />
106
+    </RelativeLayout>
101 107
 
102 108
     <com.android.views.progressbar.ProgressWheel
103 109
         android:id="@+id/wheel_wait_http"
104 110
         android:layout_width="80dp"
105 111
         android:layout_height="80dp"
106 112
         android:layout_centerInParent="true"
107
-        progress:text="@string/please_wait"
108
-        android:visibility="gone"/>
113
+        android:visibility="gone"
114
+        progress:textColor="@color/white"
115
+        progress:barColor="@color/colorPrimary"/>
109 116
 
110 117
 </RelativeLayout>

adminSystem - Gogs: Go Git Service

Geen omschrijving

README.md 6.2KB

minimatch

A minimal matching utility.

Build Status

This is the matching library used internally by npm.

It works by converting glob expressions into JavaScript RegExp objects.

Usage

var minimatch = require("minimatch")

minimatch("bar.foo", "*.foo") // true!
minimatch("bar.foo", "*.bar") // false!
minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!

Features

Supports these glob features:

  • Brace Expansion
  • Extended glob matching
  • "Globstar" ** matching

See:

  • man sh
  • man bash
  • man 3 fnmatch
  • man 5 gitignore

Minimatch Class

Create a minimatch object by instantiating the minimatch.Minimatch class.

var Minimatch = require("minimatch").Minimatch
var mm = new Minimatch(pattern, options)

Properties

  • pattern The original pattern the minimatch object represents.
  • options The options supplied to the constructor.
  • set A 2-dimensional array of regexp or string expressions. Each row in the array corresponds to a brace-expanded pattern. Each item in the row corresponds to a single path-part. For example, the pattern {a,b/c}/d would expand to a set of patterns like:

    [ [ a, d ]
    , [ b, c, d ] ]
    

    If a portion of the pattern doesn't have any "magic" in it (that is, it's something like "foo" rather than fo*o?), then it will be left as a string rather than converted to a regular expression.

  • regexp Created by the makeRe method. A single regular expression expressing the entire pattern. This is useful in cases where you wish to use the pattern somewhat like fnmatch(3) with FNM_PATH enabled.

  • negate True if the pattern is negated.

  • comment True if the pattern is a comment.

  • empty True if the pattern is "".

Methods

  • makeRe Generate the regexp member if necessary, and return it. Will return false if the pattern is invalid.
  • match(fname) Return true if the filename matches the pattern, or false otherwise.
  • matchOne(fileArray, patternArray, partial) Take a /-split filename, and match it against a single row in the regExpSet. This method is mainly for internal use, but is exposed so that it can be used by a glob-walker that needs to avoid excessive filesystem calls.

All other methods are internal, and will be called as necessary.

minimatch(path, pattern, options)

Main export. Tests a path against the pattern using the options.

var isJS = minimatch(file, "*.js", { matchBase: true })

minimatch.filter(pattern, options)

Returns a function that tests its supplied argument, suitable for use with Array.filter. Example:

var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))

minimatch.match(list, pattern, options)

Match against the list of files, in the style of fnmatch or glob. If nothing is matched, and options.nonull is set, then return a list containing the pattern itself.

var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))

minimatch.makeRe(pattern, options)

Make a regular expression object from the pattern.

Options

All options are false by default.

debug

Dump a ton of stuff to stderr.

nobrace

Do not expand {a,b} and {1..3} brace sets.

noglobstar

Disable ** matching against multiple folder names.

dot

Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot.

Note that by default, a/**/b will not match a/.d/b, unless dot is set.

noext

Disable "extglob" style patterns like +(a|b).

nocase

Perform a case-insensitive match.

nonull

When a match is not found by minimatch.match, return a list containing the pattern itself if this option is set. When not set, an empty list is returned if there are no matches.

matchBase

If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123.

nocomment

Suppress the behavior of treating # at the start of a pattern as a comment.

nonegate

Suppress the behavior of treating a leading ! character as negation.

flipNegate

Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.)

Comparisons to other fnmatch/glob implementations

While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between minimatch and other implementations, and are intentional.

If the pattern starts with a ! character, then it is negated. Set the nonegate flag to suppress this behavior, and treat leading ! characters normally. This is perhaps relevant if you wish to start the pattern with a negative extglob pattern like !(a|B). Multiple ! characters at the start of a pattern will negate the pattern multiple times.

If a pattern starts with #, then it is treated as a comment, and will not match anything. Use \# to match a literal # at the start of a line, or set the nocomment flag to suppress this behavior.

The double-star character ** is supported by default, unless the noglobstar flag is set. This is supported in the manner of bsdglob and bash 4.1, where ** only has special significance if it is the only thing in a path part. That is, a/**/b will match a/x/y/b, but a/**b will not.

If an escaped pattern has no matches, and the nonull flag is set, then minimatch.match returns the pattern as-provided, rather than interpreting the character escapes. For example, minimatch.match([], "\\*a\\?") will return "\\*a\\?" rather than "*a?". This is akin to setting the nullglob option in bash, except that it does not resolve escaped pattern characters.

If brace expansion is not disabled, then it is performed before any other interpretation of the glob pattern. Thus, a pattern like +(a|{b),c)}, which would not be valid in bash or zsh, is expanded first into the set of +(a|b) and +(a|c), and those patterns are checked for validity. Since those two are valid, matching proceeds.