Parcourir la source

项目 提交

Lailin il y a 4 ans
commit
cada9e1be1
44 fichiers modifiés avec 1438 ajouts et 0 suppressions
  1. 34 0
      .gitignore
  2. 1 0
      app/.gitignore
  3. 51 0
      app/build.gradle
  4. 21 0
      app/proguard-rules.pro
  5. 26 0
      app/src/androidTest/java/com/poto/timeservice/ExampleInstrumentedTest.java
  6. 28 0
      app/src/main/AndroidManifest.xml
  7. 102 0
      app/src/main/java/com/poto/timeservice/MainActivity.java
  8. 122 0
      app/src/main/java/com/poto/timeservice/Member/PoCreateMemberAdapter.java
  9. 14 0
      app/src/main/java/com/poto/timeservice/Member/PoCreateMemberCell.java
  10. 94 0
      app/src/main/java/com/poto/timeservice/Member/PoCreateMemberController.java
  11. 62 0
      app/src/main/java/com/poto/timeservice/Model/PoMemberEditRowModel.java
  12. 83 0
      app/src/main/java/com/poto/timeservice/Model/PoMemberModel.java
  13. 20 0
      app/src/main/java/com/poto/timeservice/PoCommon.java
  14. 12 0
      app/src/main/java/com/poto/timeservice/PoRootItemCell.java
  15. 87 0
      app/src/main/java/com/poto/timeservice/PotMainAdapter.java
  16. 31 0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  17. 74 0
      app/src/main/res/drawable/ic_launcher_background.xml
  18. 32 0
      app/src/main/res/layout-v26/activity_po_create_member_cell.xml
  19. 67 0
      app/src/main/res/layout/activity_main.xml
  20. 33 0
      app/src/main/res/layout/activity_po_create_member_cell.xml
  21. 28 0
      app/src/main/res/layout/activity_po_create_member_controller.xml
  22. 49 0
      app/src/main/res/layout/activity_po_root_item_cell.xml
  23. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  24. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  25. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  26. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  27. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  28. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  29. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  30. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  31. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  32. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  33. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  34. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  35. 15 0
      app/src/main/res/values/colors.xml
  36. 3 0
      app/src/main/res/values/strings.xml
  37. 27 0
      app/src/main/res/values/styles.xml
  38. 17 0
      app/src/test/java/com/poto/timeservice/ExampleUnitTest.java
  39. 31 0
      build.gradle
  40. BIN
      gradle/wrapper/gradle-wrapper.jar
  41. 6 0
      gradle/wrapper/gradle-wrapper.properties
  42. 172 0
      gradlew
  43. 84 0
      gradlew.bat
  44. 2 0
      settings.gradle

+ 34 - 0
.gitignore

@@ -0,0 +1,34 @@
+.gradle
+local.properties
+gradle.properties
+.DS_Store
+build/
+captures/
+
+# built application files
+*.apk
+*.ap_
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+bin/
+gen/
+
+# Local configuration file (sdk path, etc)
+# Eclipse project files
+.classpath
+.project
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Intellij project files
+*.iml
+*.ipr
+*.iws
+.idea/

+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 51 - 0
app/build.gradle

@@ -0,0 +1,51 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 30
+    buildToolsVersion "30.0.0"
+
+    defaultConfig {
+        applicationId "com.poto.timeservice"
+        minSdkVersion 21
+        targetSdkVersion 30
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+        debug {
+            ext.alwaysUpdateBuildId = false
+        }
+    }
+
+    // Butterknife requires Java 8.
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+    dataBinding {
+        enabled = true
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+    implementation 'androidx.appcompat:appcompat:1.1.0'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    testImplementation 'junit:junit:4.12'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+    /*butterknife*/
+    implementation 'com.jakewharton:butterknife:10.2.1'
+    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
+
+    implementation 'androidx.recyclerview:recyclerview:1.0.0'
+}

+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 0
app/src/androidTest/java/com/poto/timeservice/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.poto.timeservice;
+
+import android.content.Context;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+        assertEquals("com.poto.timeservice", appContext.getPackageName());
+    }
+}

+ 28 - 0
app/src/main/AndroidManifest.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.poto.timeservice">
+
+    <application
+            android:allowBackup="true"
+            android:icon="@mipmap/ic_launcher"
+            android:label="@string/app_name"
+            android:roundIcon="@mipmap/ic_launcher_round"
+            android:supportsRtl="true"
+            android:theme="@style/AppTheme">
+        <activity android:name=".Member.PoCreateMemberCell">
+        </activity>
+        <activity android:name=".Member.PoCreateMemberController">
+        </activity>
+        <activity android:name=".PoRootItemCell">
+        </activity> <!-- 注册activity -->
+        <activity android:name=".PotMainAdapter"/>
+        <activity android:name=".MainActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 102 - 0
app/src/main/java/com/poto/timeservice/MainActivity.java

@@ -0,0 +1,102 @@
+package com.poto.timeservice;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import com.poto.timeservice.Member.PoCreateMemberController;
+import com.poto.timeservice.Model.PoMemberModel;
+
+public class MainActivity extends AppCompatActivity implements View.OnClickListener {
+    // params
+    @BindView(R.id.searchBar)
+    EditText searchBar;
+    @BindView(R.id.tableView)
+    RecyclerView tableView;
+    @BindView(R.id.createBtn)
+    Button createBtn;
+    @BindView(R.id.memberBtn)
+    Button memberBtn;
+
+    // 数据
+    private PotMainAdapter adapter;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+        ButterKnife.bind(this);
+        setupSubViews();
+        configSubViews();
+    }
+
+    private void setupSubViews() {
+        adapter = new PotMainAdapter(this);
+
+        LinearLayoutManager layout = new LinearLayoutManager(this);
+        tableView.setLayoutManager(layout);
+        tableView.setAdapter(adapter);
+    }
+
+    private void configSubViews() {
+        createBtn.setOnClickListener(this);
+        memberBtn.setOnClickListener(this);
+        /*输入监控*/
+        searchBar.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+            }
+
+            @Override
+            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+            }
+
+            @Override
+            public void afterTextChanged(Editable editable) {
+                String text = editable.toString();
+                filterMemberWithText(text);
+            }
+        });
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.createBtn: {
+                createBtnClickAction();
+            }
+            break;
+            case R.id.memberBtn: {
+                memberBtnClickAction();
+            }
+            break;
+        }
+    }
+
+    /*点击事件*/
+    void createBtnClickAction() {
+        /*新建会员界面*/
+        Intent controller = new Intent(MainActivity.this, PoCreateMemberController.class);
+        startActivity(controller);
+    }
+
+    void memberBtnClickAction() {
+        adapter.removeObject(3);
+    }
+
+    /*辅助*/
+    /*
+     * 筛选 列表
+     * */
+    void filterMemberWithText(String text) {
+
+    }
+}

+ 122 - 0
app/src/main/java/com/poto/timeservice/Member/PoCreateMemberAdapter.java

@@ -0,0 +1,122 @@
+package com.poto.timeservice.Member;
+
+import android.content.Context;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.TextView;
+import androidx.recyclerview.widget.RecyclerView;
+import com.poto.timeservice.Model.PoMemberEditRowModel;
+import com.poto.timeservice.Model.PoMemberModel;
+import com.poto.timeservice.PoCommon;
+import com.poto.timeservice.R;
+import java.util.ArrayList;
+
+/*会员 adapter*/
+public class PoCreateMemberAdapter extends RecyclerView.Adapter<PoCreateMemberAdapter.PotViewHolder>  {
+    private final LayoutInflater layout;
+    private final Context theContext;
+    /*标记编辑模式*/
+    private Boolean editType;
+    /*当前录入的用户资料*/
+    private PoMemberModel theMember;
+    /*编辑字段的key值*/
+    private ArrayList<PoMemberEditRowModel> dataSource;
+
+    public PoCreateMemberAdapter(Context context, PoMemberModel editMemmber) {
+        layout = LayoutInflater.from(context);
+        theContext = context;
+
+        dataSource = new ArrayList<>();
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowInput, "姓名", "请输入姓名", "name"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowDate, "生日", "请选择生日", "birth"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowInput, "电话", "请输入电话", "tel"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowProvCA, "省份", "请选择省份", "prov"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowProvCA, "城市", "请选择城市", "city"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowProvCA, "区域", "请选择区域", "area"));
+        dataSource.add(PoMemberEditRowModel.create(PoCommon.PoMemberEditRowKind.PoMemberEditRowMutInput, "地址", "请输入地址", "address"));
+
+        editType = (editMemmber != null);
+        if (!editType) {
+            theMember = new PoMemberModel();
+        } else {
+            theMember = editMemmber;
+        }
+    }
+
+    @Override
+    public PoCreateMemberAdapter.PotViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        return new PoCreateMemberAdapter.PotViewHolder(layout.inflate(R.layout.activity_po_create_member_cell, parent, false));
+    }
+
+    @Override
+    public void onBindViewHolder(final PoCreateMemberAdapter.PotViewHolder holder, int pos) {
+        PoMemberEditRowModel model = dataSource.get(pos);
+        holder.markLab.setText(model.getMark());
+        holder.inputField.setHint(model.getPlaceholder());
+        holder.inputField.setCursorVisible(false);
+
+        /*点击|输入区分*/
+        switch (model.getKind()) {
+            case PoMemberEditRowDate:
+            case PoMemberEditRowProvCA:
+            case PoMemberEditRowStrList: {
+                holder.inputField
+            }
+                break;
+            case PoMemberEditRowInput:
+            case PoMemberEditRowMutInput: {
+                holder.inputField.addTextChangedListener(new TextWatcher() {
+                    @Override
+                    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+                    }
+
+                    @Override
+                    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+                    }
+
+                    @Override
+                    public void afterTextChanged(Editable editable) {
+
+                    }
+                });
+            }
+                break;
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        return dataSource == null ? 0 : dataSource.size();
+    }
+
+    /*数据操作*/
+    public void addObject(PoMemberEditRowModel model) {
+        dataSource.add(model);
+        notifyItemInserted(dataSource.size() - 1);
+    }
+
+    public void removeObject(int pos) {
+        dataSource.remove(pos);
+        notifyItemRemoved(pos);
+    }
+
+    /*view*/
+    static class PotViewHolder extends RecyclerView.ViewHolder {
+        /*标记*/
+        TextView markLab;
+        /*输入*/
+        EditText inputField;
+
+        PotViewHolder(View itemView) {
+            super(itemView);
+            markLab = itemView.findViewById(R.id.markLab);
+            inputField = itemView.findViewById(R.id.inputField);
+        }
+    }
+}

+ 14 - 0
app/src/main/java/com/poto/timeservice/Member/PoCreateMemberCell.java

@@ -0,0 +1,14 @@
+package com.poto.timeservice.Member;
+
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import com.poto.timeservice.R;
+
+public class PoCreateMemberCell extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_po_create_member_cell);
+    }
+}

+ 94 - 0
app/src/main/java/com/poto/timeservice/Member/PoCreateMemberController.java

@@ -0,0 +1,94 @@
+package com.poto.timeservice.Member;
+
+import android.content.Context;
+import android.os.IBinder;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import butterknife.BindView;
+import com.poto.timeservice.R;
+import butterknife.ButterKnife;
+
+public class PoCreateMemberController extends AppCompatActivity {
+    // params
+    @BindView(R.id.tableView)
+    RecyclerView tableView;
+
+    // 数据
+    private PoCreateMemberAdapter adapter;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_po_create_member_controller);
+        ButterKnife.bind(this);
+        setupSubViews();
+        configSubViews();
+    }
+
+    private void setupSubViews() {
+        adapter = new PoCreateMemberAdapter(this, null);
+
+        LinearLayoutManager layout = new LinearLayoutManager(this);
+        tableView.setLayoutManager(layout);
+        tableView.setAdapter(adapter);
+    }
+
+    private void configSubViews() {
+        this.setTitle("新建会员");
+    }
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+            View v = getCurrentFocus();
+            if (isShouldHideKeyboard(v, ev)) {
+                hideKeyboard(((View) v).getWindowToken());
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    /**
+     * 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时则不能隐藏
+     *
+     * @param v
+     * @param event
+     * @return
+     */
+    private boolean isShouldHideKeyboard(View v, MotionEvent event) {
+        if (v != null && (v instanceof EditText)) {
+            int[] l = {0, 0};
+            v.getLocationInWindow(l);
+            int left = l[0],
+                    top = l[1],
+                    bottom = top + v.getHeight(),
+                    right = left + v.getWidth();
+            if (event.getX() > left && event.getX() < right
+                    && event.getY() > top && event.getY() < bottom) {
+                // 点击EditText的事件,忽略它。
+                return false;
+            } else {
+                return true;
+            }
+        }
+        // 如果焦点不是EditText则忽略,这个发生在视图刚绘制完,第一个焦点不在EditText上,和用户用轨迹球选择其他的焦点
+        return false;
+    }
+
+    /**
+     * 获取InputMethodManager,隐藏软键盘
+     * @param token
+     */
+    private void hideKeyboard(IBinder token) {
+        if (token != null) {
+            InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+            im.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS);
+        }
+    }
+}

+ 62 - 0
app/src/main/java/com/poto/timeservice/Model/PoMemberEditRowModel.java

@@ -0,0 +1,62 @@
+package com.poto.timeservice.Model;
+
+import androidx.databinding.BaseObservable;
+import com.poto.timeservice.PoCommon;
+
+import java.util.List;
+
+public class PoMemberEditRowModel extends BaseObservable {
+    /*类型*/
+    private PoCommon.PoMemberEditRowKind kind;
+    /*显示mark*/
+    private String mark;
+    /*占位*/
+    private String placeholder;
+    /*对应model值*/
+    private String key;
+
+    public PoCommon.PoMemberEditRowKind getKind() {
+        return kind;
+    }
+
+    public void setKind(PoCommon.PoMemberEditRowKind kind) {
+        this.kind = kind;
+    }
+
+    public String getMark() {
+        return mark;
+    }
+
+    public void setMark(String mark) {
+        this.mark = mark;
+    }
+
+    public String getPlaceholder() {
+        return placeholder;
+    }
+
+    public void setPlaceholder(String placeholder) {
+        this.placeholder = placeholder;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    /*初始化*/
+    public static PoMemberEditRowModel create(PoCommon.PoMemberEditRowKind kind,
+                                              String mark,
+                                              String placeholder,
+                                              String key) {
+        PoMemberEditRowModel model = new PoMemberEditRowModel();
+        model.setKind(kind);
+        model.setMark(mark);
+        model.setPlaceholder(placeholder);
+        model.setKey(key);
+        return model;
+    }
+}

+ 83 - 0
app/src/main/java/com/poto/timeservice/Model/PoMemberModel.java

@@ -0,0 +1,83 @@
+package com.poto.timeservice.Model;
+
+import androidx.databinding.BaseObservable;
+import androidx.databinding.Bindable;
+
+public class PoMemberModel extends BaseObservable {
+    @Bindable
+    private String name;
+    private String birth;
+    private String tel;
+    /*地址*/
+    private String prov;
+    private String city;
+    private String area;
+    private String address;
+    /*购买资料*/
+    private String createTime;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getBirth() {
+        return birth;
+    }
+
+    public void setBirth(String birth) {
+        this.birth = birth;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getProv() {
+        return prov;
+    }
+
+    public void setProv(String prov) {
+        this.prov = prov;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getArea() {
+        return area;
+    }
+
+    public void setArea(String area) {
+        this.area = area;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+}

+ 20 - 0
app/src/main/java/com/poto/timeservice/PoCommon.java

@@ -0,0 +1,20 @@
+package com.poto.timeservice;
+
+public class PoCommon {
+    /*检查null数据,返回""*/
+    public static String checkNull(String text) {
+        if (text == null) {
+            return "";
+        }
+        return text;
+    }
+
+    /*枚举cell类型*/
+    public static enum PoMemberEditRowKind {
+        PoMemberEditRowInput, /*输入*/
+        PoMemberEditRowStrList, /*text列表选择*/
+        PoMemberEditRowDate, /*日期*/
+        PoMemberEditRowProvCA, /*省份|城市|区域*/
+        PoMemberEditRowMutInput, /*多行输入*/
+    }
+}

+ 12 - 0
app/src/main/java/com/poto/timeservice/PoRootItemCell.java

@@ -0,0 +1,12 @@
+package com.poto.timeservice;
+
+import android.os.Bundle;
+import androidx.appcompat.app.AppCompatActivity;
+
+public class PoRootItemCell extends AppCompatActivity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_po_root_item_cell);
+    }
+}

+ 87 - 0
app/src/main/java/com/poto/timeservice/PotMainAdapter.java

@@ -0,0 +1,87 @@
+package com.poto.timeservice;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+import androidx.recyclerview.widget.RecyclerView;
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import com.poto.timeservice.Model.PoMemberModel;
+
+import java.util.ArrayList;
+
+/*tableView Adapter*/
+public class PotMainAdapter extends RecyclerView.Adapter<PotMainAdapter.PotViewHolder> {
+    private final LayoutInflater layout;
+    private final Context theContext;
+    private final ArrayList<PoMemberModel> dataSource;
+
+    public PotMainAdapter(Context context) {
+        layout = LayoutInflater.from(context);
+        theContext = context;
+
+        dataSource = new ArrayList<>();
+        for (int i = 0; i < 3; i++) {
+            PoMemberModel member = new PoMemberModel();
+            member.setName("Poto" + Integer.toString(i));
+            member.setTel("1560123");
+            member.setAddress("罗家村");
+            dataSource.add(member);
+        }
+    }
+
+    @Override
+    public PotMainAdapter.PotViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+        return new PotViewHolder(layout.inflate(R.layout.activity_po_root_item_cell, parent, false));
+    }
+
+    @Override
+    public void onBindViewHolder(final PotMainAdapter.PotViewHolder holder, int pos) {
+        PoMemberModel member = dataSource.get(pos);
+        holder.nameLab.setText(member.getName());
+        holder.telLab.setText(member.getTel());
+        /*地址*/
+        holder.displayDetailAddr(member.getProv(), member.getCity(), member.getArea(), member.getAddress());
+    }
+
+    @Override
+    public int getItemCount() {
+        return dataSource == null ? 0 : dataSource.size();
+    }
+
+    /*数据操作*/
+    public void addObject(PoMemberModel member) {
+        dataSource.add(member);
+        notifyItemInserted(dataSource.size() - 1);
+    }
+
+    public void removeObject(int pos) {
+        dataSource.remove(pos);
+        notifyItemRemoved(pos);
+    }
+
+    /*view*/
+    static class PotViewHolder extends RecyclerView.ViewHolder {
+        /*姓名*/
+        TextView nameLab;
+        /*电话*/
+        TextView telLab;
+        /*详细地址*/
+        TextView addrLab;
+
+        PotViewHolder(View itemView) {
+            super(itemView);
+            nameLab = itemView.findViewById(R.id.nameLab);
+            telLab = itemView.findViewById(R.id.telLab);
+            addrLab = itemView.findViewById(R.id.addrLab);
+        }
+
+        /*设置详细地址*/
+        public void displayDetailAddr(String prov, String city, String area, String addr) {
+            String str = " 详细地址:" + PoCommon.checkNull(prov) + PoCommon.checkNull(city) + PoCommon.checkNull(area) + PoCommon.checkNull(addr);
+            addrLab.setText(str);
+        }
+    }
+}

Fichier diff supprimé car celui-ci est trop grand
+ 31 - 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml


+ 74 - 0
app/src/main/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:height="108dp"
+        android:width="108dp"
+        android:viewportHeight="108"
+        android:viewportWidth="108">
+    <path android:fillColor="#3DDC84"
+          android:pathData="M0,0h108v108h-108z"/>
+    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+</vector>

+ 32 - 0
app/src/main/res/layout-v26/activity_po_create_member_cell.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="44dp"
+        tools:context=".Member.PoCreateMemberCell">
+    <TextView
+            android:id="@+id/markLab"
+            android:text="Mark"
+            android:textSize="16sp"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="12dp"
+            app:layout_constraintVertical_chainStyle="packed"
+            app:layout_constraintWidth_max="80dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+    <EditText
+            android:id="@+id/inputField"
+            android:hint="Input"
+            android:textSize="16sp"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:paddingStart="8dp"
+            app:layout_constraintLeft_toRightOf="@+id/markLab"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintRight_toRightOf="parent" tools:ignore="RtlSymmetry"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 67 - 0
app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        tools:context=".MainActivity">
+
+    <LinearLayout
+            android:id="@+id/topView"
+            android:layout_width="match_parent"
+            android:layout_height="44dp"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent">
+        <ImageView
+                android:id="@+id/searchIcon"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginVertical="10dp"
+                app:srcCompat="?android:attr/actionModeWebSearchDrawable"/>
+        <EditText
+                android:id="@+id/searchBar"
+                android:layout_width="match_parent"
+                android:singleLine="true"
+                android:layout_height="44dp"
+                android:layout_marginLeft="4dp"/>
+    </LinearLayout>
+
+    <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/tableView"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:scrollbars="vertical"
+            app:layout_constraintTop_toBottomOf="@id/topView"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintBottom_toTopOf="@+id/constraintLayout"/>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/constraintLayout"
+            android:layout_width="match_parent"
+            android:layout_height="44dp"
+            app:layout_constraintTop_toBottomOf="@id/tableView"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent">
+        <Button
+                android:id="@+id/createBtn"
+                style="@style/PotWhiteButton"
+                android:text="新建会员"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                app:layout_constraintWidth_percent="0.5"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toTopOf="parent"/>
+
+        <Button
+                android:id="@+id/memberBtn"
+                style="@style/PotDarkButton"
+                android:text="会员列表"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                app:layout_constraintLeft_toRightOf="@id/createBtn"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintRight_toRightOf="parent"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 33 - 0
app/src/main/res/layout/activity_po_create_member_cell.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="64dp"
+        tools:context=".Member.PoCreateMemberCell">
+    <TextView
+            android:id="@+id/markLab"
+            android:text="Mark"
+            android:textSize="16sp"
+            android:layout_width="0dp"
+            android:layout_height="21dp"
+            android:layout_marginStart="12dp"
+            app:layout_constraintVertical_chainStyle="packed"
+            app:layout_constraintWidth_max="80dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+    <EditText
+            android:id="@+id/inputField"
+            android:textSize="16sp"
+            android:hint="Pls Input"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp"
+            app:layout_constraintLeft_toRightOf="@+id/markLab"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 28 - 0
app/src/main/res/layout/activity_po_create_member_controller.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        tools:context=".Member.PoCreateMemberController">
+    <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/tableView"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:scrollbars="vertical"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintBottom_toTopOf="@id/saveBtn"
+            app:layout_constraintTop_toTopOf="parent"/>
+    <Button
+            android:id="@+id/saveBtn"
+            style="@style/PotDarkButton"
+            android:text="保存"
+            android:layout_width="match_parent"
+            android:layout_height="44dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/tableView"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 49 - 0
app/src/main/res/layout/activity_po_root_item_cell.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        tools:context=".PoRootItemCell">
+
+    <TextView
+            android:id="@+id/nameLab"
+            android:text="姓名:Poto"
+            android:textSize="21sp"
+            android:layout_width="wrap_content"
+            android:layout_height="30dp"
+            android:layout_marginStart="12dp"
+            android:layout_marginTop="10dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"/>
+
+    <TextView
+            android:id="@+id/telLab"
+            android:text="Tel:15602389969"
+            android:textSize="21sp"
+            android:layout_width="0dp"
+            android:layout_height="30dp"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="10dp"
+            android:layout_marginTop="10dp"
+            app:layout_constraintLeft_toRightOf="@id/nameLab"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintRight_toRightOf="parent"/>
+
+    <TextView
+            android:id="@+id/addrLab"
+            android:text="详细地址:广州番禺区"
+            android:textSize="16sp"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="12dp"
+            android:layout_marginEnd="10dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginBottom="10dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/nameLab"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"/>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background"/>
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
+</adaptive-icon>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background"/>
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
+</adaptive-icon>

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 15 - 0
app/src/main/res/values/colors.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#6200EE</color>
+    <color name="colorPrimaryDark">#3700B3</color>
+    <color name="colorAccent">#03DAC5</color>
+
+    <!--颜色-->
+    <!--White-->
+    <color name="PotColor_FFFFFF">#FFFFFF</color>
+    <color name="PotColor_F0F4F8">#F0F4F8</color>
+    <!--Dark-->
+    <color name="PotColor_101E40">#101E40</color>
+    <color name="PotColor_34A6FF">#34A6FF</color>
+    <color name="PotColor_FF587A">#FF587A</color>
+</resources>

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">吉祥之舍</string>
+</resources>

+ 27 - 0
app/src/main/res/values/styles.xml

@@ -0,0 +1,27 @@
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <!--按钮样式-->
+    <style name="PotDarkButton" parent="TextAppearance.AppCompat.Button">
+        <item name="android:background">@color/PotColor_101E40</item>
+        <item name="android:textColor">@color/PotColor_FFFFFF</item>
+        <item name="android:textSize">16dp</item>
+    </style>
+    <style name="PotWhiteButton" parent="TextAppearance.AppCompat.Button">
+        <item name="android:textColor">@color/PotColor_101E40</item>
+        <item name="android:background">@color/PotColor_F0F4F8</item>
+        <item name="android:textSize">16dp</item>
+    </style>
+    <!--输入框样式-->
+    <style name="PotInputEditText" parent="TextAppearance.AppCompat.Widget.TextView.SpinnerItem">
+
+    </style>
+
+</resources>

+ 17 - 0
app/src/test/java/com/poto/timeservice/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.poto.timeservice;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 31 - 0
build.gradle

@@ -0,0 +1,31 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    
+    repositories {
+        google()
+        jcenter()
+        
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.6.4'
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+        classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'
+        classpath 'com.android.tools.build:gradle:2.1.0'
+
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        jcenter()
+        
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Sun Jun 21 22:29:53 CST 2020
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME

+ 172 - 0
gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ]; do
+  ls=$(ls -ld "$PRG")
+  link=$(expr "$ls" : '.*-> \(.*\)$')
+  if expr "$link" : '/.*' >/dev/null; then
+    PRG="$link"
+  else
+    PRG=$(dirname "$PRG")"/$link"
+  fi
+done
+SAVED="$(pwd)"
+cd "$(dirname \"$PRG\")/" >/dev/null
+APP_HOME="$(pwd -P)"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=$(basename "$0")
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn() {
+  echo "$*"
+}
+
+die() {
+  echo
+  echo "$*"
+  echo
+  exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$(uname)" in
+CYGWIN*)
+  cygwin=true
+  ;;
+Darwin*)
+  darwin=true
+  ;;
+MINGW*)
+  msys=true
+  ;;
+NONSTOP*)
+  nonstop=true
+  ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ]; then
+  if [ -x "$JAVA_HOME/jre/sh/java" ]; then
+    # IBM's JDK on AIX uses strange locations for the executables
+    JAVACMD="$JAVA_HOME/jre/sh/java"
+  else
+    JAVACMD="$JAVA_HOME/bin/java"
+  fi
+  if [ ! -x "$JAVACMD" ]; then
+    die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+  fi
+else
+  JAVACMD="java"
+  which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
+  MAX_FD_LIMIT=$(ulimit -H -n)
+  if [ $? -eq 0 ]; then
+    if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+      MAX_FD="$MAX_FD_LIMIT"
+    fi
+    ulimit -n $MAX_FD
+    if [ $? -ne 0 ]; then
+      warn "Could not set maximum file descriptor limit: $MAX_FD"
+    fi
+  else
+    warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+  fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+  GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  APP_HOME=$(cygpath --path --mixed "$APP_HOME")
+  CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
+  JAVACMD=$(cygpath --unix "$JAVACMD")
+
+  # We build the pattern for arguments to be converted via cygpath
+  ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
+  SEP=""
+  for dir in $ROOTDIRSRAW; do
+    ROOTDIRS="$ROOTDIRS$SEP$dir"
+    SEP="|"
+  done
+  OURCYGPATTERN="(^($ROOTDIRS))"
+  # Add a user-defined pattern to the cygpath arguments
+  if [ "$GRADLE_CYGPATTERN" != "" ]; then
+    OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+  fi
+  # Now convert the arguments - kludge to limit ourselves to /bin/sh
+  i=0
+  for arg in "$@"; do
+    CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
+    CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
+
+    if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
+      eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
+    else
+      eval $(echo args$i)="\"$arg\""
+    fi
+    i=$((i + 1))
+  done
+  case $i in
+  0) set -- ;;
+  1) set -- "$args0" ;;
+  2) set -- "$args0" "$args1" ;;
+  3) set -- "$args0" "$args1" "$args2" ;;
+  4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+  5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+  6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+  7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+  8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+  9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+  esac
+fi
+
+# Escape application args
+save() {
+  for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
+  echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 2 - 0
settings.gradle

@@ -0,0 +1,2 @@
+rootProject.name='TimeService'
+include ':app'