├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── MaterialPreference
├── MaterialPreference.iml
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── fonts
│ │ ├── Roboto-Medium.ttf
│ │ └── Roboto-Regular.ttf
│ ├── java
│ └── com
│ │ └── jenzz
│ │ └── materialpreference
│ │ ├── CheckBoxPreference.java
│ │ ├── Preference.java
│ │ ├── PreferenceCategory.java
│ │ ├── PreferenceImageView.java
│ │ ├── SwitchPreference.java
│ │ ├── ThemeUtils.java
│ │ ├── TwoStatePreference.java
│ │ └── Typefaces.java
│ └── res
│ ├── layout
│ ├── mp_checkbox_preference.xml
│ ├── mp_preference.xml
│ ├── mp_preference_category.xml
│ └── mp_switch_preference.xml
│ └── values
│ └── mp_attrs.xml
├── Notes.iml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── libs
│ ├── BmobSDK_V3.3.8_0521.jar
│ ├── fastjson.jar
│ └── libammsdk.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lguipeng
│ │ └── notes
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── lguipeng
│ │ └── notes
│ │ ├── App.java
│ │ ├── adpater
│ │ ├── BaseListAdapter.java
│ │ ├── BaseRecyclerViewAdapter.java
│ │ ├── ColorsListAdapter.java
│ │ ├── DrawerListAdapter.java
│ │ ├── MaterialSimpleListAdapter.java
│ │ ├── NotesAdapter.java
│ │ ├── NotesItemViewHolder.java
│ │ └── SimpleListAdapter.java
│ │ ├── listener
│ │ ├── bmob
│ │ │ ├── FindListenerImpl.java
│ │ │ ├── SaveListenerImpl.java
│ │ │ └── UpdateListenerImpl.java
│ │ └── view
│ │ │ └── RecyclerViewClickListener.java
│ │ ├── model
│ │ ├── CloudNote.java
│ │ ├── MaterialSimpleListItem.java
│ │ ├── Note.java
│ │ ├── NoteOperateLog.java
│ │ └── NoteType.java
│ │ ├── module
│ │ ├── AppModule.java
│ │ └── DataModule.java
│ │ ├── ui
│ │ ├── AboutActivity.java
│ │ ├── BaseActivity.java
│ │ ├── EditNoteTypeActivity.java
│ │ ├── MainActivity.java
│ │ ├── NoteActivity.java
│ │ ├── PayActivity.java
│ │ ├── SettingActivity.java
│ │ └── fragments
│ │ │ ├── BaseFragment.java
│ │ │ └── SettingFragment.java
│ │ ├── utils
│ │ ├── AccountUtils.java
│ │ ├── JsonUtils.java
│ │ ├── NoteConfig.java
│ │ ├── NotesLog.java
│ │ ├── PreferenceUtils.java
│ │ ├── SnackbarUtils.java
│ │ ├── ThemeUtils.java
│ │ ├── TimeUtils.java
│ │ ├── ViewHelper.java
│ │ └── WXUtils.java
│ │ └── view
│ │ └── FixedRecyclerView.java
│ └── res
│ ├── drawable-hdpi
│ ├── ic_done_white.png
│ └── ic_edit_white.png
│ ├── drawable-xhdpi
│ ├── alipay_erweima.jpg
│ ├── ic_done_white.png
│ ├── ic_edit_white.png
│ ├── ic_more_grey.png
│ ├── ic_share_more.png
│ ├── ic_sina_logo.png
│ ├── ic_wx_collect.png
│ ├── ic_wx_logo.png
│ └── ic_wx_moments.png
│ ├── drawable-xxhdpi
│ ├── ic_done_white.png
│ └── ic_edit_white.png
│ ├── drawable
│ ├── activated_background.xml
│ ├── blue_grey_round.xml
│ ├── blue_round.xml
│ ├── brown_round.xml
│ ├── deep_purple_round.xml
│ ├── green_round.xml
│ ├── pink_round.xml
│ ├── red_round.xml
│ ├── selectable_background.xml
│ ├── toolbar_shadow.xml
│ ├── white_button_background.xml
│ └── yellow_round.xml
│ ├── layout
│ ├── activity_about.xml
│ ├── activity_edit_note_type.xml
│ ├── activity_main.xml
│ ├── activity_note.xml
│ ├── activity_pay.xml
│ ├── activity_setting.xml
│ ├── colors_image_layout.xml
│ ├── colors_panel_layout.xml
│ ├── drawer_list_item_layout.xml
│ ├── edit_layout.xml
│ ├── md_simplelist_item.xml
│ ├── notes_item_layout.xml
│ ├── toolbar_layout.xml
│ └── toolbar_shadow_layout.xml
│ ├── menu
│ ├── menu_about.xml
│ ├── menu_main.xml
│ ├── menu_note.xml
│ └── menu_notes_more.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── prefs.xml
│ └── searchable.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── orm-library
├── .gitignore
├── build.gradle
├── orm-library.iml
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── lguipeng
│ │ └── library
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── net
│ │ └── tsz
│ │ └── afinal
│ │ ├── FinalDb.java
│ │ ├── annotation
│ │ └── sqlite
│ │ │ ├── Id.java
│ │ │ ├── ManyToOne.java
│ │ │ ├── OneToMany.java
│ │ │ ├── Property.java
│ │ │ ├── Table.java
│ │ │ └── Transient.java
│ │ ├── core
│ │ ├── AbstractCollection.java
│ │ ├── ArrayDeque.java
│ │ ├── Arrays.java
│ │ ├── AsyncTask.java
│ │ ├── Deque.java
│ │ ├── FileNameGenerator.java
│ │ └── Queue.java
│ │ ├── db
│ │ ├── sqlite
│ │ │ ├── CursorUtils.java
│ │ │ ├── DbModel.java
│ │ │ ├── ManyToOneLazyLoader.java
│ │ │ ├── OneToManyLazyLoader.java
│ │ │ ├── SqlBuilder.java
│ │ │ └── SqlInfo.java
│ │ └── table
│ │ │ ├── Id.java
│ │ │ ├── KeyValue.java
│ │ │ ├── ManyToOne.java
│ │ │ ├── OneToMany.java
│ │ │ ├── Property.java
│ │ │ └── TableInfo.java
│ │ ├── exception
│ │ ├── AfinalException.java
│ │ └── DbException.java
│ │ └── utils
│ │ ├── ClassUtils.java
│ │ ├── FieldUtils.java
│ │ └── Utils.java
│ └── res
│ └── values
│ └── strings.xml
├── screenshot
├── S50603-103314.jpg
├── S50605-164248.jpg
├── S50605-164615.jpg
├── S50611-163425.jpg
├── S50611-163752.jpg
├── S50611-164132.jpg
└── S50611-164146.jpg
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 | /captures
8 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | Notes
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | 1.7
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MaterialPreference/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion Integer.parseInt(ANDROID_BUILD_COMPILE_SDK_VERSION)
5 | buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
6 |
7 | defaultConfig {
8 | minSdkVersion Integer.parseInt(MIN_SDK_VERSION)
9 | targetSdkVersion Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
10 | versionCode Integer.parseInt(VERSION_CODE)
11 | versionName VERSION_NAME
12 | }
13 |
14 | lintOptions {
15 | abortOnError false
16 | }
17 | }
18 |
19 | dependencies {
20 | compile 'com.android.support:appcompat-v7:22.2.0'
21 | compile 'com.balysv:material-ripple:1.0.2'
22 | }
--------------------------------------------------------------------------------
/MaterialPreference/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/assets/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimajia/Notes/0b743136b2080dec363b156b8ebea7c019270c27/MaterialPreference/src/main/assets/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/MaterialPreference/src/main/assets/fonts/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimajia/Notes/0b743136b2080dec363b156b8ebea7c019270c27/MaterialPreference/src/main/assets/fonts/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/CheckBoxPreference.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.CheckBox;
8 |
9 | import static com.jenzz.materialpreference.ThemeUtils.isAtLeastL;
10 |
11 | public class CheckBoxPreference extends TwoStatePreference {
12 |
13 | public CheckBoxPreference(Context context) {
14 | super(context);
15 | init(context, null, 0, 0);
16 | }
17 |
18 | public CheckBoxPreference(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | init(context, attrs, 0, 0);
21 | }
22 |
23 | public CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
24 | super(context, attrs, defStyleAttr);
25 | init(context, attrs, defStyleAttr, 0);
26 | }
27 |
28 | public CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr,
29 | int defStyleRes) {
30 | super(context, attrs, defStyleAttr, defStyleRes);
31 | init(context, attrs, defStyleAttr, defStyleRes);
32 | }
33 |
34 | private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
35 | TypedArray typedArray = context.obtainStyledAttributes(attrs, new int[] {
36 | android.R.attr.summaryOn, android.R.attr.summaryOff, android.R.attr.disableDependentsState
37 | }, defStyleAttr, defStyleRes);
38 |
39 | setSummaryOn(typedArray.getString(0));
40 | setSummaryOff(typedArray.getString(1));
41 | setDisableDependentsState(typedArray.getBoolean(2, false));
42 |
43 | typedArray.recycle();
44 |
45 | setWidgetLayoutResource(R.layout.mp_checkbox_preference);
46 | }
47 |
48 | @Override @SuppressWarnings("deprecation")
49 | protected void onBindView(View view) {
50 | super.onBindView(view);
51 |
52 | CheckBox checkboxView = (CheckBox) view.findViewById(R.id.checkbox);
53 | checkboxView.setChecked(isChecked());
54 |
55 | if (isAtLeastL()) {
56 | // remove circular background when pressed
57 | checkboxView.setBackgroundDrawable(null);
58 | }
59 |
60 | syncSummaryView(view);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/Preference.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.graphics.drawable.Drawable;
7 | import android.util.AttributeSet;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import static android.content.Context.LAYOUT_INFLATER_SERVICE;
15 | import static android.os.Build.VERSION_CODES.LOLLIPOP;
16 | import static android.text.TextUtils.isEmpty;
17 | import static android.view.View.GONE;
18 | import static android.view.View.VISIBLE;
19 | import static com.jenzz.materialpreference.Typefaces.getRobotoRegular;
20 |
21 | public class Preference extends android.preference.Preference {
22 |
23 | TextView titleView;
24 | TextView summaryView;
25 |
26 | ImageView imageView;
27 | View imageFrame;
28 |
29 | private int iconResId;
30 | private Drawable icon;
31 |
32 | public Preference(Context context) {
33 | super(context);
34 | init(context, null, 0, 0);
35 | }
36 |
37 | public Preference(Context context, AttributeSet attrs) {
38 | super(context, attrs);
39 | init(context, attrs, 0, 0);
40 | }
41 |
42 | public Preference(Context context, AttributeSet attrs, int defStyleAttr) {
43 | super(context, attrs, defStyleAttr);
44 | init(context, attrs, defStyleAttr, 0);
45 | }
46 |
47 | @TargetApi(LOLLIPOP)
48 | public Preference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
49 | super(context, attrs, defStyleAttr, defStyleRes);
50 | init(context, attrs, defStyleAttr, defStyleRes);
51 | }
52 |
53 | private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
54 | TypedArray typedArray =
55 | context.obtainStyledAttributes(attrs, new int[] { android.R.attr.icon }, defStyleAttr,
56 | defStyleRes);
57 | iconResId = typedArray.getResourceId(0, 0);
58 | typedArray.recycle();
59 | }
60 |
61 | @Override
62 | protected View onCreateView(ViewGroup parent) {
63 | LayoutInflater layoutInflater =
64 | (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
65 | View layout = layoutInflater.inflate(R.layout.mp_preference, parent, false);
66 |
67 | ViewGroup widgetFrame = (ViewGroup) layout.findViewById(R.id.widget_frame);
68 | int widgetLayoutResId = getWidgetLayoutResource();
69 | if (widgetLayoutResId != 0) {
70 | layoutInflater.inflate(widgetLayoutResId, widgetFrame);
71 | }
72 | widgetFrame.setVisibility(widgetLayoutResId != 0 ? VISIBLE : GONE);
73 |
74 | return layout;
75 | }
76 |
77 | @Override
78 | protected void onBindView(View view) {
79 | super.onBindView(view);
80 |
81 | CharSequence title = getTitle();
82 | titleView = (TextView) view.findViewById(R.id.title);
83 | titleView.setText(title);
84 | titleView.setVisibility(!isEmpty(title) ? VISIBLE : GONE);
85 | titleView.setTypeface(getRobotoRegular(getContext()));
86 |
87 | CharSequence summary = getSummary();
88 | summaryView = (TextView) view.findViewById(R.id.summary);
89 | summaryView.setText(summary);
90 | summaryView.setVisibility(!isEmpty(summary) ? VISIBLE : GONE);
91 | summaryView.setTypeface(getRobotoRegular(getContext()));
92 |
93 | if (icon == null && iconResId > 0) {
94 | icon = getContext().getResources().getDrawable(iconResId);
95 | }
96 | imageView = (ImageView) view.findViewById(R.id.icon);
97 | imageView.setImageDrawable(icon);
98 | imageView.setVisibility(icon != null ? VISIBLE : GONE);
99 |
100 | imageFrame = view.findViewById(R.id.icon_frame);
101 | imageFrame.setVisibility(icon != null ? VISIBLE : GONE);
102 | }
103 |
104 | @Override
105 | public void setIcon(int iconResId) {
106 | super.setIcon(iconResId);
107 | this.iconResId = iconResId;
108 | }
109 |
110 | @Override
111 | public void setIcon(Drawable icon) {
112 | super.setIcon(icon);
113 | this.icon = icon;
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceCategory.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.TextView;
10 |
11 | import static android.content.Context.LAYOUT_INFLATER_SERVICE;
12 | import static android.os.Build.VERSION_CODES.LOLLIPOP;
13 | import static android.text.TextUtils.isEmpty;
14 | import static android.view.View.GONE;
15 | import static android.view.View.VISIBLE;
16 | import static com.jenzz.materialpreference.ThemeUtils.resolveAccentColor;
17 | import static com.jenzz.materialpreference.Typefaces.getRobotoMedium;
18 |
19 | public class PreferenceCategory extends android.preference.PreferenceCategory {
20 |
21 | private int accentColor;
22 |
23 | public PreferenceCategory(Context context) {
24 | super(context);
25 | init();
26 | }
27 |
28 | public PreferenceCategory(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | init();
31 | }
32 |
33 | public PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr) {
34 | super(context, attrs, defStyleAttr);
35 | init();
36 | }
37 |
38 | @TargetApi(LOLLIPOP)
39 | public PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr,
40 | int defStyleRes) {
41 | super(context, attrs, defStyleAttr, defStyleRes);
42 | init();
43 | }
44 |
45 | private void init() {
46 | accentColor = resolveAccentColor(getContext());
47 | }
48 |
49 | @Override
50 | protected View onCreateView(ViewGroup parent) {
51 | LayoutInflater layoutInflater =
52 | (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
53 | return layoutInflater.inflate(R.layout.mp_preference_category, parent, false);
54 | }
55 |
56 | @Override
57 | protected void onBindView(View view) {
58 | super.onBindView(view);
59 |
60 | CharSequence title = getTitle();
61 | TextView titleView = (TextView) view.findViewById(R.id.title);
62 | titleView.setText(title);
63 | titleView.setTextColor(accentColor);
64 | titleView.setVisibility(!isEmpty(title) ? VISIBLE : GONE);
65 | titleView.setTypeface(getRobotoMedium(getContext()));
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceImageView.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.widget.ImageView;
7 |
8 | import static android.os.Build.VERSION_CODES.LOLLIPOP;
9 | import static android.view.View.MeasureSpec.AT_MOST;
10 | import static android.view.View.MeasureSpec.UNSPECIFIED;
11 | import static android.view.View.MeasureSpec.getMode;
12 | import static android.view.View.MeasureSpec.getSize;
13 | import static android.view.View.MeasureSpec.makeMeasureSpec;
14 | import static java.lang.Integer.MAX_VALUE;
15 |
16 | /**
17 | * Extension of ImageView that correctly applies maxWidth and maxHeight.
18 | */
19 | public class PreferenceImageView extends ImageView {
20 |
21 | private int maxWidth = MAX_VALUE;
22 | private int maxHeight = MAX_VALUE;
23 |
24 | public PreferenceImageView(Context context) {
25 | super(context);
26 | }
27 |
28 | public PreferenceImageView(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | }
31 |
32 | public PreferenceImageView(Context context, AttributeSet attrs, int defStyleAttr) {
33 | super(context, attrs, defStyleAttr);
34 | }
35 |
36 | @TargetApi(LOLLIPOP)
37 | public PreferenceImageView(Context context, AttributeSet attrs, int defStyleAttr,
38 | int defStyleRes) {
39 | super(context, attrs, defStyleAttr, defStyleRes);
40 | }
41 |
42 | @Override
43 | public void setMaxWidth(int maxWidth) {
44 | super.setMaxWidth(maxWidth);
45 | this.maxWidth = maxWidth;
46 | }
47 |
48 | @Override
49 | public void setMaxHeight(int maxHeight) {
50 | super.setMaxHeight(maxHeight);
51 | this.maxHeight = maxHeight;
52 | }
53 |
54 | @Override
55 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
56 | int widthMode = getMode(widthMeasureSpec);
57 | if (widthMode == AT_MOST || widthMode == UNSPECIFIED) {
58 | int widthSize = getSize(widthMeasureSpec);
59 | if (maxWidth != MAX_VALUE && (maxWidth < widthSize || widthMode == UNSPECIFIED)) {
60 | widthMeasureSpec = makeMeasureSpec(maxWidth, AT_MOST);
61 | }
62 | }
63 |
64 | int heightMode = getMode(heightMeasureSpec);
65 | if (heightMode == AT_MOST || heightMode == UNSPECIFIED) {
66 | int heightSize = getSize(heightMeasureSpec);
67 | if (maxHeight != MAX_VALUE && (maxHeight < heightSize || heightMode == UNSPECIFIED)) {
68 | heightMeasureSpec = makeMeasureSpec(maxHeight, AT_MOST);
69 | }
70 | }
71 |
72 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
73 | }
74 | }
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/SwitchPreference.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.support.v7.widget.SwitchCompat;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 |
9 | public class SwitchPreference extends TwoStatePreference {
10 |
11 | public SwitchPreference(Context context) {
12 | super(context);
13 | init(context, null, 0, 0);
14 | }
15 |
16 | public SwitchPreference(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | init(context, attrs, 0, 0);
19 | }
20 |
21 | public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
22 | super(context, attrs, defStyleAttr);
23 | init(context, attrs, defStyleAttr, 0);
24 | }
25 |
26 | public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
27 | super(context, attrs, defStyleAttr, defStyleRes);
28 | init(context, attrs, defStyleAttr, defStyleRes);
29 | }
30 |
31 | private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
32 | TypedArray typedArray = context.obtainStyledAttributes(attrs, new int[] {
33 | android.R.attr.summaryOn, android.R.attr.summaryOff, android.R.attr.disableDependentsState
34 | }, defStyleAttr, defStyleRes);
35 |
36 | setSummaryOn(typedArray.getString(0));
37 | setSummaryOff(typedArray.getString(1));
38 | setDisableDependentsState(typedArray.getBoolean(2, false));
39 |
40 | typedArray.recycle();
41 |
42 | setWidgetLayoutResource(R.layout.mp_switch_preference);
43 | }
44 |
45 | @Override
46 | protected void onBindView(View view) {
47 | super.onBindView(view);
48 |
49 | SwitchCompat switchCompat = (SwitchCompat) view.findViewById(R.id.switch_compat);
50 | switchCompat.setChecked(isChecked());
51 |
52 | syncSummaryView(view);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/ThemeUtils.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.annotation.TargetApi;
4 | import android.content.Context;
5 | import android.content.res.Resources.Theme;
6 | import android.content.res.TypedArray;
7 |
8 | import static android.graphics.Color.parseColor;
9 | import static android.os.Build.VERSION.SDK_INT;
10 | import static android.os.Build.VERSION_CODES.LOLLIPOP;
11 |
12 | final class ThemeUtils {
13 |
14 | // material_deep_teal_500
15 | static final int FALLBACK_COLOR = parseColor("#009688");
16 |
17 | private ThemeUtils() {
18 | // no instances
19 | }
20 |
21 | static boolean isAtLeastL() {
22 | return SDK_INT >= LOLLIPOP;
23 | }
24 |
25 | @TargetApi(LOLLIPOP)
26 | static int resolveAccentColor(Context context) {
27 | Theme theme = context.getTheme();
28 |
29 | // on Lollipop, grab system colorAccent attribute
30 | // pre-Lollipop, grab AppCompat colorAccent attribute
31 | // finally, check for custom mp_colorAccent attribute
32 | int attr = isAtLeastL() ? android.R.attr.colorAccent : R.attr.colorAccent;
33 | TypedArray typedArray = theme.obtainStyledAttributes(new int[] { attr, R.attr.mp_colorAccent });
34 |
35 | int accentColor = typedArray.getColor(0, FALLBACK_COLOR);
36 | accentColor = typedArray.getColor(1, accentColor);
37 | typedArray.recycle();
38 |
39 | return accentColor;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/java/com/jenzz/materialpreference/Typefaces.java:
--------------------------------------------------------------------------------
1 | package com.jenzz.materialpreference;
2 |
3 | import android.content.Context;
4 | import android.graphics.Typeface;
5 | import android.util.Log;
6 | import java.util.Hashtable;
7 |
8 | final class Typefaces {
9 |
10 | private static final String TAG = Typefaces.class.getSimpleName();
11 | private static final Hashtable cache = new Hashtable<>();
12 |
13 | private Typefaces() {
14 | // no instances
15 | }
16 |
17 | static Typeface get(Context context, String assetPath) {
18 | synchronized (cache) {
19 | if (!cache.containsKey(assetPath)) {
20 | try {
21 | Typeface t = Typeface.createFromAsset(context.getAssets(), assetPath);
22 | cache.put(assetPath, t);
23 | } catch (Exception e) {
24 | Log.e(TAG, "Could not get typeface '" + assetPath + "' Error: " + e.getMessage());
25 | return null;
26 | }
27 | }
28 | return cache.get(assetPath);
29 | }
30 | }
31 |
32 | static Typeface getRobotoRegular(Context context) {
33 | return get(context, "fonts/Roboto-Regular.ttf");
34 | }
35 |
36 | static Typeface getRobotoMedium(Context context) {
37 | return get(context, "fonts/Roboto-Medium.ttf");
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/res/layout/mp_checkbox_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/res/layout/mp_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
18 |
30 |
37 |
38 |
39 |
46 |
47 |
56 |
57 |
67 |
68 |
69 |
70 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/res/layout/mp_preference_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/res/layout/mp_switch_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MaterialPreference/src/main/res/values/mp_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/Notes.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #ScreenShot
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | #1.1.2
14 | - 增加了多款彩色主题的选择
15 | - 增加了关于界面的分享功能
16 | - 修复了笔记过长的显示问题
17 | - 修复了SwipeRefreshLayout和RecyclerView的组合问题
18 | - 优化界面的一些细节,修复已知的小bug
19 |
20 | #1.1.0
21 | - 增加了笔记列表的卡片式的布局,可在设置里面切换
22 | - 增加了下拉同步笔记的组件
23 | - 增加编辑笔记时点击返回询问是否保存
24 | - 使用了Snackbar代替了Toast的提示
25 | - 去除了编辑笔记内容的下划线
26 | - 修改了笔记列表的显示时间方式
27 | - 修复了小米2s 5.0上CardView的显示问题
28 |
29 | #1.0.2
30 | - Material Design风格,采用抽屉式菜单,悬浮滑动按钮,点击控件时的水波纹效果,状态栏透明使得与应用融为一体,用户即使在Android L系统以下的手机也能感受到良好的用户体验
31 | - 用文字记录身边随时发生的事情,或者你的待办事项
32 | - 同步,同步需要你在手机设置里面添加一个邮箱,并作为你的同步账号,提交到服务器
33 |
34 | #License
35 | ```
36 | Copyright 2015 Liaoguipeng
37 |
38 | Licensed under the Apache License, Version 2.0 (the "License");
39 | you may not use this file except in compliance with the License.
40 | You may obtain a copy of the License at
41 |
42 | http://www.apache.org/licenses/LICENSE-2.0
43 |
44 | Unless required by applicable law or agreed to in writing, software
45 | distributed under the License is distributed on an "AS IS" BASIS,
46 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 | See the License for the specific language governing permissions and
48 | limitations under the License.
49 | ```
50 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | def packTime() {
3 | return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("UTC"))
4 | }
5 |
6 | def projectUrl = "https://github.com/lguipeng/Notes"
7 | def blogUrl = "http://www.jianshu.com/users/f612d54d668e/latest_articles"
8 | def appDownloadUrl = "http://notes.55058a091d225.d01.nanoyun.com/release/notes.apk"
9 | def aboutAppUrl = "http://www.jianshu.com/p/640a7f2fe0c5"
10 |
11 | //remember to add your bmob app key in local.properties
12 | Properties properties = new Properties()
13 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
14 | def bmobAppKey = properties.getProperty('BMOB_KEY')
15 | def weChatId = properties.getProperty('WECHAT_ID')
16 | android {
17 | signingConfigs {
18 | debug {
19 |
20 | }
21 | release {
22 | //setting your signing.properties
23 | //first, add signing.properties to ./app/
24 | //second, add property STORE_FILE, STORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD
25 | }
26 | }
27 | compileSdkVersion Integer.parseInt(ANDROID_BUILD_COMPILE_SDK_VERSION)
28 | buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
29 | defaultConfig {
30 | applicationId "com.lguipeng.notes"
31 | minSdkVersion Integer.parseInt(MIN_SDK_VERSION)
32 | targetSdkVersion Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
33 | versionCode Integer.parseInt(VERSION_CODE)
34 | versionName VERSION_NAME
35 |
36 | buildConfigField "String", "BMOB_KEY", "\"${bmobAppKey}\""
37 | buildConfigField "String", "WECHAT_ID", "\"${weChatId}\""
38 | buildConfigField "String", "APP_DOWNLOAD_URL", "\"${appDownloadUrl}\""
39 | buildConfigField "String", "PROJECT_URL", "\"${projectUrl}\""
40 | buildConfigField "String", "BLOG_URL", "\"${blogUrl}\""
41 | buildConfigField "String", "ABOUT_APP_URL", "\"${aboutAppUrl}\""
42 | }
43 | buildTypes {
44 |
45 | debug {
46 | versionNameSuffix " Beta"
47 | minifyEnabled false
48 | zipAlignEnabled false
49 | shrinkResources false
50 | signingConfig signingConfigs.debug
51 | }
52 | release {
53 | minifyEnabled false
54 | zipAlignEnabled false
55 | shrinkResources true
56 | signingConfig signingConfigs.release
57 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
58 | }
59 | }
60 | packagingOptions {
61 | exclude 'META-INF/LICENSE.txt'
62 | exclude 'META-INF/NOTICE.txt'
63 | }
64 | lintOptions {
65 | abortOnError false
66 | }
67 |
68 | applicationVariants.all { variant ->
69 | variant.outputs.each { output ->
70 | def outputFile = output.outputFile
71 | if (outputFile != null && outputFile.name.endsWith('.apk')) {
72 | File outputDirectory = new File(outputFile.parent);
73 | def fileName
74 | if (variant.buildType.name == "release") {
75 | fileName = "notes_v${defaultConfig.versionName}_${packTime()}.apk"
76 | }else{
77 | fileName = "notes_beta.apk"
78 | }
79 | output.outputFile = new File(outputDirectory, fileName)
80 | }
81 | }
82 |
83 | }
84 | }
85 |
86 | dependencies {
87 | compile fileTree(include: ['*.jar'], dir: 'libs')
88 | compile 'com.android.support:support-v4:22.2.0'
89 | compile 'com.android.support:appcompat-v7:22.2.0'
90 | compile 'com.android.support:recyclerview-v7:22.2.0'
91 | compile 'com.android.support:cardview-v7:22.2.0'
92 | compile 'com.jakewharton:butterknife:6.1.0'
93 | compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
94 | compile 'com.melnykov:floatingactionbutton:1.3.0'
95 | compile 'com.rengwuxian.materialedittext:library:2.1.3'
96 | compile 'com.squareup.dagger:dagger:1.2.2'
97 | provided 'com.squareup.dagger:dagger-compiler:1.2.2'
98 | compile 'de.greenrobot:eventbus:2.4.0'
99 | compile 'com.pnikosis:materialish-progress:1.5'
100 | compile 'com.nispok:snackbar:2.10.10'
101 | compile project(':orm-library')
102 | compile project(':MaterialPreference')
103 | }
104 |
105 | File propFile = file('signing.properties');
106 | if (propFile.exists()) {
107 | def Properties props = new Properties()
108 | props.load(new FileInputStream(propFile))
109 | if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
110 | props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
111 | android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
112 | android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
113 | android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
114 | android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
115 | } else {
116 | android.buildTypes.release.signingConfig = null
117 | }
118 | } else {
119 | android.buildTypes.release.signingConfig = null
120 | }
--------------------------------------------------------------------------------
/app/libs/BmobSDK_V3.3.8_0521.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimajia/Notes/0b743136b2080dec363b156b8ebea7c019270c27/app/libs/BmobSDK_V3.3.8_0521.jar
--------------------------------------------------------------------------------
/app/libs/fastjson.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimajia/Notes/0b743136b2080dec363b156b8ebea7c019270c27/app/libs/fastjson.jar
--------------------------------------------------------------------------------
/app/libs/libammsdk.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/daimajia/Notes/0b743136b2080dec363b156b8ebea7c019270c27/app/libs/libammsdk.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in E:\adt-bundle-windows-x86_64-20131030/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/lguipeng/notes/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.lguipeng.notes;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
34 |
35 |
36 |
41 |
42 |
43 |
47 |
48 |
49 |
53 |
54 |
55 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/lguipeng/notes/App.java:
--------------------------------------------------------------------------------
1 | package com.lguipeng.notes;
2 |
3 | import android.app.Application;
4 |
5 | import com.lguipeng.notes.module.AppModule;
6 |
7 | import java.util.Arrays;
8 | import java.util.List;
9 |
10 | import cn.bmob.v3.Bmob;
11 | import dagger.ObjectGraph;
12 |
13 | /**
14 | * Created by lgp on 2015/5/24.
15 | */
16 | public class App extends Application{
17 | private ObjectGraph objectGraph;
18 | @Override
19 | public void onCreate() {
20 | super.onCreate();
21 | objectGraph = ObjectGraph.create(getModules().toArray());
22 | objectGraph.inject(this);
23 | Bmob.initialize(this, BuildConfig.BMOB_KEY);
24 | }
25 |
26 | @Override
27 | public void onTerminate() {
28 | super.onTerminate();
29 | }
30 |
31 | @Override
32 | public void onLowMemory() {
33 | super.onLowMemory();
34 | }
35 |
36 | private List