T getField(Class targetClass, Object instance, String fieldName) {
766 | try {
767 | Field field = targetClass.getDeclaredField(fieldName);
768 | field.setAccessible(true);
769 | return (T) field.get(instance);
770 | } catch (NoSuchFieldException e) {
771 | e.printStackTrace();
772 | } catch (IllegalAccessException e) {
773 | e.printStackTrace();
774 | }
775 | return null;
776 | }
777 |
778 | /**
779 | * change the field value
780 | *
781 | * @param targetClass
782 | * @param instance the filed owner
783 | * @param fieldName
784 | * @param value
785 | */
786 | private void setField(Class targetClass, Object instance, String fieldName, Object value) {
787 | try {
788 | Field field = targetClass.getDeclaredField(fieldName);
789 | field.setAccessible(true);
790 | field.set(instance, value);
791 | } catch (NoSuchFieldException e) {
792 | e.printStackTrace();
793 | } catch (IllegalAccessException e) {
794 | e.printStackTrace();
795 | }
796 | }
797 |
798 | /**
799 | * This method will link the given ViewPager and this BottomNavigationViewEx together so that
800 | * changes in one are automatically reflected in the other. This includes scroll state changes
801 | * and clicks.
802 | *
803 | * @param viewPager
804 | */
805 | public void setupWithViewPager(@Nullable final ViewPager viewPager) {
806 | setupWithViewPager(viewPager, false);
807 | }
808 |
809 | /**
810 | * This method will link the given ViewPager and this BottomNavigationViewEx together so that
811 | * changes in one are automatically reflected in the other. This includes scroll state changes
812 | * and clicks.
813 | *
814 | * @param viewPager
815 | * @param smoothScroll whether ViewPager changed with smooth scroll animation
816 | */
817 | public void setupWithViewPager(@Nullable final ViewPager viewPager, boolean smoothScroll) {
818 | if (mViewPager != null) {
819 | // If we've already been setup with a ViewPager, remove us from it
820 | if (mPageChangeListener != null) {
821 | mViewPager.removeOnPageChangeListener(mPageChangeListener);
822 | }
823 | }
824 |
825 | if (null == viewPager) {
826 | mViewPager = null;
827 | super.setOnNavigationItemSelectedListener(null);
828 | return;
829 | }
830 |
831 | mViewPager = viewPager;
832 |
833 | // Add our custom OnPageChangeListener to the ViewPager
834 | if (mPageChangeListener == null) {
835 | mPageChangeListener = new BottomNavigationViewExOnPageChangeListener(this);
836 | }
837 | viewPager.addOnPageChangeListener(mPageChangeListener);
838 |
839 | // Now we'll add a navigation item selected listener to set ViewPager's current item
840 | OnNavigationItemSelectedListener listener = getOnNavigationItemSelectedListener();
841 | mMyOnNavigationItemSelectedListener = new MyOnNavigationItemSelectedListener(viewPager, this, smoothScroll, listener);
842 | super.setOnNavigationItemSelectedListener(mMyOnNavigationItemSelectedListener);
843 | }
844 |
845 | /**
846 | * A {@link ViewPager.OnPageChangeListener} class which contains the
847 | * necessary calls back to the provided {@link BottomNavigationViewEx} so that the tab position is
848 | * kept in sync.
849 | *
850 | *
This class stores the provided BottomNavigationViewEx weakly, meaning that you can use
851 | * {@link ViewPager#addOnPageChangeListener(ViewPager.OnPageChangeListener)
852 | * addOnPageChangeListener(OnPageChangeListener)} without removing the listener and
853 | * not cause a leak.
854 | */
855 | private static class BottomNavigationViewExOnPageChangeListener implements ViewPager.OnPageChangeListener {
856 | private final WeakReference mBnveRef;
857 |
858 | public BottomNavigationViewExOnPageChangeListener(BottomNavigationViewEx bnve) {
859 | mBnveRef = new WeakReference<>(bnve);
860 | }
861 |
862 | @Override
863 | public void onPageScrollStateChanged(final int state) {
864 | }
865 |
866 | @Override
867 | public void onPageScrolled(final int position, final float positionOffset,
868 | final int positionOffsetPixels) {
869 | }
870 |
871 | @Override
872 | public void onPageSelected(final int position) {
873 | final BottomNavigationViewEx bnve = mBnveRef.get();
874 | if (null != bnve && !isNavigationItemClicking)
875 | bnve.setCurrentItem(position);
876 | // Log.d("onPageSelected", "--------- position " + position + " ------------");
877 | }
878 | }
879 |
880 | /**
881 | * Decorate OnNavigationItemSelectedListener for setupWithViewPager
882 | */
883 | private static class MyOnNavigationItemSelectedListener implements OnNavigationItemSelectedListener {
884 | private OnNavigationItemSelectedListener listener;
885 | private final WeakReference viewPagerRef;
886 | private boolean smoothScroll;
887 | private SparseIntArray items;// used for change ViewPager selected item
888 | private int previousPosition = -1;
889 |
890 |
891 | MyOnNavigationItemSelectedListener(ViewPager viewPager, BottomNavigationViewEx bnve, boolean smoothScroll, OnNavigationItemSelectedListener listener) {
892 | this.viewPagerRef = new WeakReference<>(viewPager);
893 | this.listener = listener;
894 | this.smoothScroll = smoothScroll;
895 |
896 | // create items
897 | Menu menu = bnve.getMenu();
898 | int size = menu.size();
899 | items = new SparseIntArray(size);
900 | for (int i = 0; i < size; i++) {
901 | int itemId = menu.getItem(i).getItemId();
902 | items.put(itemId, i);
903 | }
904 | }
905 |
906 | public void setOnNavigationItemSelectedListener(OnNavigationItemSelectedListener listener) {
907 | this.listener = listener;
908 | }
909 |
910 | @Override
911 | public boolean onNavigationItemSelected(@NonNull MenuItem item) {
912 | int position = items.get(item.getItemId());
913 | // only set item when item changed
914 | if (previousPosition == position) {
915 | return true;
916 | }
917 | // Log.d("onNavigationItemSelecte", "position:" + position);
918 | // user listener
919 | if (null != listener) {
920 | boolean bool = listener.onNavigationItemSelected(item);
921 | // if the selected is invalid, no need change the view pager
922 | if (!bool)
923 | return false;
924 | }
925 |
926 | // change view pager
927 | ViewPager viewPager = viewPagerRef.get();
928 | if (null == viewPager)
929 | return false;
930 |
931 | // use isNavigationItemClicking flag to avoid `ViewPager.OnPageChangeListener` trigger
932 | isNavigationItemClicking = true;
933 | viewPager.setCurrentItem(items.get(item.getItemId()), smoothScroll);
934 | isNavigationItemClicking = false;
935 |
936 | // update previous position
937 | previousPosition = position;
938 |
939 | return true;
940 | }
941 |
942 | }
943 |
944 | @SuppressLint("RestrictedApi")
945 | public void enableShiftingMode(int position, boolean enable) {
946 | getBottomNavigationItemView(position).setShifting(enable);
947 | }
948 | @SuppressLint("RestrictedApi")
949 | public void setItemBackground(int position, int background) {
950 | getBottomNavigationItemView(position).setItemBackground(background);
951 | }
952 | @SuppressLint("RestrictedApi")
953 | public void setIconTintList(int position, ColorStateList tint) {
954 | getBottomNavigationItemView(position).setIconTintList(tint);
955 | }
956 | @SuppressLint("RestrictedApi")
957 | public void setTextTintList(int position, ColorStateList tint) {
958 | getBottomNavigationItemView(position).setTextColor(tint);
959 | }
960 |
961 | /**
962 | * set margin top for all icons
963 | *
964 | * @param marginTop in px
965 | */
966 | public void setIconsMarginTop(int marginTop) {
967 | for (int i = 0; i < getItemCount(); i++) {
968 | setIconMarginTop(i, marginTop);
969 | }
970 | }
971 |
972 | /**
973 | * set margin top for icon
974 | *
975 | * @param position
976 | * @param marginTop in px
977 | */
978 | @SuppressLint("RestrictedApi")
979 | public void setIconMarginTop(int position, int marginTop) {
980 | /*
981 | 1. BottomNavigationItemView
982 | 2. private final int mDefaultMargin;
983 | */
984 | BottomNavigationItemView itemView = getBottomNavigationItemView(position);
985 | setField(BottomNavigationItemView.class, itemView, "defaultMargin", marginTop);
986 | mMenuView.updateMenuView();
987 | }
988 |
989 | }
990 |
--------------------------------------------------------------------------------
/app/src/main/res/color/selector_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/color/selector_nav_item_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/add_todo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/add_todo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/arrow_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/arrow_right.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/cancel_todo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/cancel_todo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/complete_todo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/complete_todo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/date.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/delete_todo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/drawable-xxhdpi/delete_todo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_complete.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_setting.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_todo.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_add_todo.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
21 |
26 |
40 |
45 |
54 |
59 |
60 |
71 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit_todo.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
13 |
19 |
30 |
31 |
35 |
40 |
47 |
60 |
61 |
66 |
75 |
80 |
81 |
92 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
20 |
21 |
27 |
28 |
32 |
33 |
42 |
43 |
44 |
45 |
49 |
50 |
59 |
60 |
61 |
62 |
71 |
72 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_register.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
21 |
22 |
31 |
32 |
33 |
34 |
38 |
39 |
48 |
49 |
50 |
51 |
55 |
56 |
65 |
66 |
67 |
68 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_todo_des_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
22 |
27 |
34 |
42 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_complete.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
18 |
24 |
31 |
41 |
42 |
46 |
53 |
62 |
63 |
64 |
68 |
73 |
80 |
86 |
93 |
102 |
103 |
107 |
113 |
120 |
129 |
130 |
131 |
135 |
140 |
151 |
155 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_todo.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/title_bar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
21 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/todo_item_head.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
16 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/todo_item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
17 |
24 |
31 |
40 |
49 |
50 |
56 |
57 |
61 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2AB27F
4 | #2AB27F
5 | #FF4081
6 | #828282
7 | #f8f8f8
8 | #449577
9 | #ADADAD
10 | #E4A340
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | TODO
3 | 正在加载中……
4 | 服务器开小差,请稍候重试
5 |
6 |
7 | 账号
8 | 密码
9 | 登录
10 | 还没账号,点击注册
11 | 请输入账号
12 | 请输入密码
13 | 待办清单
14 | 完成清单
15 | 高效率 慢生活
16 | 设置
17 | 注册
18 | 请输入确认密码
19 | 两次输入的密码不一致
20 | 注册成功
21 | 输入待办名称,如:准备演示PPT
22 | 输入待办详情,非必填,如:\n1、制作演示PPT\n2、预定会议室\n3、通知参加会议人员\n4、提前10分钟准备会议环境
23 | 保存
24 | 添加待办清单
25 | 清单详细
26 | 请输入待办名称
27 | 添加成功
28 | 更新成功
29 | 删除成功
30 | 标记完成
31 | 撤销完成
32 | 完成时间:%s
33 | 账号信息
34 | 修改密码
35 | https://github.com/wjwang0914
36 | github
37 | API
38 | http://www.wanandroid.com/
39 | 本宝宝暂时还没有想到详细信息
40 | 待办名称
41 | 待办详细
42 | 删除待办清单
43 | 请确认是否删除?
44 | 取消
45 | 确定
46 | 标题:
47 | 详情:
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/test/java/com/wj/android/todo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.wj.android.todo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.2.1'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | maven { url "https://jitpack.io" }
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/gradle.properties
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Aug 07 10:46:04 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/release/app-release.apk
--------------------------------------------------------------------------------
/screenshots/000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/000.png
--------------------------------------------------------------------------------
/screenshots/001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/001.png
--------------------------------------------------------------------------------
/screenshots/002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/002.png
--------------------------------------------------------------------------------
/screenshots/003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/003.png
--------------------------------------------------------------------------------
/screenshots/004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/004.png
--------------------------------------------------------------------------------
/screenshots/005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/005.png
--------------------------------------------------------------------------------
/screenshots/006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/006.png
--------------------------------------------------------------------------------
/screenshots/007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/007.png
--------------------------------------------------------------------------------
/screenshots/008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/008.png
--------------------------------------------------------------------------------
/screenshots/009.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/009.png
--------------------------------------------------------------------------------
/screenshots/010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/010.png
--------------------------------------------------------------------------------
/screenshots/011.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/011.png
--------------------------------------------------------------------------------
/screenshots/012.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wjwang0914/wj-todo-wanandroid/91046a88307ee231f820cc7540d170c063f17ab1/screenshots/012.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | include ':wj-http'
3 |
--------------------------------------------------------------------------------