Full Code of daimajia/Notes for AI

master 0b743136b208 cached
157 files
501.5 KB
126.4k tokens
898 symbols
1 requests
Download .txt
Showing preview only (554K chars total). Download the full file or copy to clipboard to get everything.
Repository: daimajia/Notes
Branch: master
Commit: 0b743136b208
Files: 157
Total size: 501.5 KB

Directory structure:
gitextract_lccwb36e/

├── .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
│           ├── 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/
│               │   ├── 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
│               ├── values/
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   └── styles.xml
│               └── xml/
│                   ├── prefs.xml
│                   └── searchable.xml
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.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
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures


================================================
FILE: .idea/.name
================================================
Notes

================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CompilerConfiguration">
    <option name="DEFAULT_COMPILER" value="Javac" />
    <resourceExtensions />
    <wildcardResourcePatterns>
      <entry name="!?*.java" />
      <entry name="!?*.form" />
      <entry name="!?*.class" />
      <entry name="!?*.groovy" />
      <entry name="!?*.scala" />
      <entry name="!?*.flex" />
      <entry name="!?*.kt" />
      <entry name="!?*.clj" />
    </wildcardResourcePatterns>
    <annotationProcessing>
      <profile default="true" name="Default" enabled="false">
        <processorPath useClasspath="true" />
      </profile>
    </annotationProcessing>
  </component>
</project>

================================================
FILE: .idea/copyright/profiles_settings.xml
================================================
<component name="CopyrightManager">
  <settings default="" />
</component>

================================================
FILE: .idea/encodings.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding">
    <file url="PROJECT" charset="UTF-8" />
  </component>
</project>

================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="GradleSettings">
    <option name="linkedExternalProjectsSettings">
      <GradleProjectSettings>
        <option name="distributionType" value="DEFAULT_WRAPPED" />
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
        <option name="gradleJvm" value="1.8" />
        <option name="modules">
          <set>
            <option value="$PROJECT_DIR$" />
            <option value="$PROJECT_DIR$/MaterialPreference" />
            <option value="$PROJECT_DIR$/app" />
            <option value="$PROJECT_DIR$/orm-library" />
          </set>
        </option>
      </GradleProjectSettings>
    </option>
  </component>
</project>

================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="NullableNotNullManager">
    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
    <option name="myNullables">
      <value>
        <list size="4">
          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
        </list>
      </value>
    </option>
    <option name="myNotNulls">
      <value>
        <list size="4">
          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
        </list>
      </value>
    </option>
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
    <output url="file://$PROJECT_DIR$/build/classes" />
  </component>
  <component name="ProjectType">
    <option name="id" value="Android" />
  </component>
  <component name="masterDetails">
    <states>
      <state key="ProjectJDKs.UI">
        <settings>
          <last-edited>1.7</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>

================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/MaterialPreference/MaterialPreference.iml" filepath="$PROJECT_DIR$/MaterialPreference/MaterialPreference.iml" />
      <module fileurl="file://$PROJECT_DIR$/Notes.iml" filepath="$PROJECT_DIR$/Notes.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/orm-library/orm-library.iml" filepath="$PROJECT_DIR$/orm-library/orm-library.iml" />
    </modules>
  </component>
</project>

================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
  </component>
</project>

================================================
FILE: MaterialPreference/MaterialPreference.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":MaterialPreference" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Notes" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":MaterialPreference" />
      </configuration>
    </facet>
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="debug" />
        <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
        <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
        <option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
        <afterSyncTasks>
          <task>generateDebugAndroidTestSources</task>
          <task>generateDebugSources</task>
        </afterSyncTasks>
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
        <option name="LIBRARY_PROJECT" value="true" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.balysv/material-ripple/1.0.2/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
    </content>
    <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="material-ripple-1.0.2" level="project" />
    <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
  </component>
</module>

================================================
FILE: MaterialPreference/build.gradle
================================================
apply plugin: 'com.android.library'

android {
  compileSdkVersion Integer.parseInt(ANDROID_BUILD_COMPILE_SDK_VERSION)
  buildToolsVersion ANDROID_BUILD_TOOLS_VERSION

  defaultConfig {
    minSdkVersion Integer.parseInt(MIN_SDK_VERSION)
    targetSdkVersion Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
    versionCode Integer.parseInt(VERSION_CODE)
    versionName VERSION_NAME
  }

  lintOptions {
    abortOnError false
  }
}

dependencies {
  compile 'com.android.support:appcompat-v7:22.2.0'
  compile 'com.balysv:material-ripple:1.0.2'
}

================================================
FILE: MaterialPreference/src/main/AndroidManifest.xml
================================================
<manifest package="com.jenzz.materialpreference"/>

================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/CheckBoxPreference.java
================================================
package com.jenzz.materialpreference;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.CheckBox;

import static com.jenzz.materialpreference.ThemeUtils.isAtLeastL;

public class CheckBoxPreference extends TwoStatePreference {

  public CheckBoxPreference(Context context) {
    super(context);
    init(context, null, 0, 0);
  }

  public CheckBoxPreference(Context context, AttributeSet attrs) {
    super(context, attrs);
    init(context, attrs, 0, 0);
  }

  public CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs, defStyleAttr, 0);
  }

  public CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr,
      int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    init(context, attrs, defStyleAttr, defStyleRes);
  }

  private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    TypedArray typedArray = context.obtainStyledAttributes(attrs, new int[] {
        android.R.attr.summaryOn, android.R.attr.summaryOff, android.R.attr.disableDependentsState
    }, defStyleAttr, defStyleRes);

    setSummaryOn(typedArray.getString(0));
    setSummaryOff(typedArray.getString(1));
    setDisableDependentsState(typedArray.getBoolean(2, false));

    typedArray.recycle();

    setWidgetLayoutResource(R.layout.mp_checkbox_preference);
  }

  @Override @SuppressWarnings("deprecation")
  protected void onBindView(View view) {
    super.onBindView(view);

    CheckBox checkboxView = (CheckBox) view.findViewById(R.id.checkbox);
    checkboxView.setChecked(isChecked());

    if (isAtLeastL()) {
      // remove circular background when pressed
      checkboxView.setBackgroundDrawable(null);
    }

    syncSummaryView(view);
  }
}


================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/Preference.java
================================================
package com.jenzz.materialpreference;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static android.text.TextUtils.isEmpty;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static com.jenzz.materialpreference.Typefaces.getRobotoRegular;

public class Preference extends android.preference.Preference {

  TextView titleView;
  TextView summaryView;

  ImageView imageView;
  View imageFrame;

  private int iconResId;
  private Drawable icon;

  public Preference(Context context) {
    super(context);
    init(context, null, 0, 0);
  }

  public Preference(Context context, AttributeSet attrs) {
    super(context, attrs);
    init(context, attrs, 0, 0);
  }

  public Preference(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs, defStyleAttr, 0);
  }

  @TargetApi(LOLLIPOP)
  public Preference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    init(context, attrs, defStyleAttr, defStyleRes);
  }

  private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    TypedArray typedArray =
        context.obtainStyledAttributes(attrs, new int[] { android.R.attr.icon }, defStyleAttr,
            defStyleRes);
    iconResId = typedArray.getResourceId(0, 0);
    typedArray.recycle();
  }

  @Override
  protected View onCreateView(ViewGroup parent) {
    LayoutInflater layoutInflater =
        (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    View layout = layoutInflater.inflate(R.layout.mp_preference, parent, false);

    ViewGroup widgetFrame = (ViewGroup) layout.findViewById(R.id.widget_frame);
    int widgetLayoutResId = getWidgetLayoutResource();
    if (widgetLayoutResId != 0) {
      layoutInflater.inflate(widgetLayoutResId, widgetFrame);
    }
    widgetFrame.setVisibility(widgetLayoutResId != 0 ? VISIBLE : GONE);

    return layout;
  }

  @Override
  protected void onBindView(View view) {
    super.onBindView(view);

    CharSequence title = getTitle();
    titleView = (TextView) view.findViewById(R.id.title);
    titleView.setText(title);
    titleView.setVisibility(!isEmpty(title) ? VISIBLE : GONE);
    titleView.setTypeface(getRobotoRegular(getContext()));

    CharSequence summary = getSummary();
    summaryView = (TextView) view.findViewById(R.id.summary);
    summaryView.setText(summary);
    summaryView.setVisibility(!isEmpty(summary) ? VISIBLE : GONE);
    summaryView.setTypeface(getRobotoRegular(getContext()));

    if (icon == null && iconResId > 0) {
      icon = getContext().getResources().getDrawable(iconResId);
    }
    imageView = (ImageView) view.findViewById(R.id.icon);
    imageView.setImageDrawable(icon);
    imageView.setVisibility(icon != null ? VISIBLE : GONE);

    imageFrame = view.findViewById(R.id.icon_frame);
    imageFrame.setVisibility(icon != null ? VISIBLE : GONE);
  }

  @Override
  public void setIcon(int iconResId) {
    super.setIcon(iconResId);
    this.iconResId = iconResId;
  }

  @Override
  public void setIcon(Drawable icon) {
    super.setIcon(icon);
    this.icon = icon;
  }
}


================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceCategory.java
================================================
package com.jenzz.materialpreference;

import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import static android.content.Context.LAYOUT_INFLATER_SERVICE;
import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static android.text.TextUtils.isEmpty;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static com.jenzz.materialpreference.ThemeUtils.resolveAccentColor;
import static com.jenzz.materialpreference.Typefaces.getRobotoMedium;

public class PreferenceCategory extends android.preference.PreferenceCategory {

  private int accentColor;

  public PreferenceCategory(Context context) {
    super(context);
    init();
  }

  public PreferenceCategory(Context context, AttributeSet attrs) {
    super(context, attrs);
    init();
  }

  public PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init();
  }

  @TargetApi(LOLLIPOP)
  public PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr,
      int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    init();
  }

  private void init() {
    accentColor = resolveAccentColor(getContext());
  }

  @Override
  protected View onCreateView(ViewGroup parent) {
    LayoutInflater layoutInflater =
        (LayoutInflater) getContext().getSystemService(LAYOUT_INFLATER_SERVICE);
    return layoutInflater.inflate(R.layout.mp_preference_category, parent, false);
  }

  @Override
  protected void onBindView(View view) {
    super.onBindView(view);

    CharSequence title = getTitle();
    TextView titleView = (TextView) view.findViewById(R.id.title);
    titleView.setText(title);
    titleView.setTextColor(accentColor);
    titleView.setVisibility(!isEmpty(title) ? VISIBLE : GONE);
    titleView.setTypeface(getRobotoMedium(getContext()));
  }
}


================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceImageView.java
================================================
package com.jenzz.materialpreference;

import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static android.view.View.MeasureSpec.AT_MOST;
import static android.view.View.MeasureSpec.UNSPECIFIED;
import static android.view.View.MeasureSpec.getMode;
import static android.view.View.MeasureSpec.getSize;
import static android.view.View.MeasureSpec.makeMeasureSpec;
import static java.lang.Integer.MAX_VALUE;

/**
 * Extension of ImageView that correctly applies maxWidth and maxHeight.
 */
public class PreferenceImageView extends ImageView {

  private int maxWidth = MAX_VALUE;
  private int maxHeight = MAX_VALUE;

  public PreferenceImageView(Context context) {
    super(context);
  }

  public PreferenceImageView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public PreferenceImageView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }

  @TargetApi(LOLLIPOP)
  public PreferenceImageView(Context context, AttributeSet attrs, int defStyleAttr,
      int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
  }

  @Override
  public void setMaxWidth(int maxWidth) {
    super.setMaxWidth(maxWidth);
    this.maxWidth = maxWidth;
  }

  @Override
  public void setMaxHeight(int maxHeight) {
    super.setMaxHeight(maxHeight);
    this.maxHeight = maxHeight;
  }

  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int widthMode = getMode(widthMeasureSpec);
    if (widthMode == AT_MOST || widthMode == UNSPECIFIED) {
      int widthSize = getSize(widthMeasureSpec);
      if (maxWidth != MAX_VALUE && (maxWidth < widthSize || widthMode == UNSPECIFIED)) {
        widthMeasureSpec = makeMeasureSpec(maxWidth, AT_MOST);
      }
    }

    int heightMode = getMode(heightMeasureSpec);
    if (heightMode == AT_MOST || heightMode == UNSPECIFIED) {
      int heightSize = getSize(heightMeasureSpec);
      if (maxHeight != MAX_VALUE && (maxHeight < heightSize || heightMode == UNSPECIFIED)) {
        heightMeasureSpec = makeMeasureSpec(maxHeight, AT_MOST);
      }
    }

    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  }
}

================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/SwitchPreference.java
================================================
package com.jenzz.materialpreference;

import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
import android.view.View;

public class SwitchPreference extends TwoStatePreference {

  public SwitchPreference(Context context) {
    super(context);
    init(context, null, 0, 0);
  }

  public SwitchPreference(Context context, AttributeSet attrs) {
    super(context, attrs);
    init(context, attrs, 0, 0);
  }

  public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context, attrs, defStyleAttr, 0);
  }

  public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
    init(context, attrs, defStyleAttr, defStyleRes);
  }

  private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    TypedArray typedArray = context.obtainStyledAttributes(attrs, new int[] {
        android.R.attr.summaryOn, android.R.attr.summaryOff, android.R.attr.disableDependentsState
    }, defStyleAttr, defStyleRes);

    setSummaryOn(typedArray.getString(0));
    setSummaryOff(typedArray.getString(1));
    setDisableDependentsState(typedArray.getBoolean(2, false));

    typedArray.recycle();

    setWidgetLayoutResource(R.layout.mp_switch_preference);
  }

  @Override
  protected void onBindView(View view) {
    super.onBindView(view);

    SwitchCompat switchCompat = (SwitchCompat) view.findViewById(R.id.switch_compat);
    switchCompat.setChecked(isChecked());

    syncSummaryView(view);
  }
}


================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/ThemeUtils.java
================================================
package com.jenzz.materialpreference;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;

import static android.graphics.Color.parseColor;
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.LOLLIPOP;

final class ThemeUtils {

  // material_deep_teal_500
  static final int FALLBACK_COLOR = parseColor("#009688");

  private ThemeUtils() {
    // no instances
  }

  static boolean isAtLeastL() {
    return SDK_INT >= LOLLIPOP;
  }

  @TargetApi(LOLLIPOP)
  static int resolveAccentColor(Context context) {
    Theme theme = context.getTheme();

    // on Lollipop, grab system colorAccent attribute
    // pre-Lollipop, grab AppCompat colorAccent attribute
    // finally, check for custom mp_colorAccent attribute
    int attr = isAtLeastL() ? android.R.attr.colorAccent : R.attr.colorAccent;
    TypedArray typedArray = theme.obtainStyledAttributes(new int[] { attr, R.attr.mp_colorAccent });

    int accentColor = typedArray.getColor(0, FALLBACK_COLOR);
    accentColor = typedArray.getColor(1, accentColor);
    typedArray.recycle();

    return accentColor;
  }

}


================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/TwoStatePreference.java
================================================
package com.jenzz.materialpreference;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;

import static android.text.TextUtils.isEmpty;

public abstract class TwoStatePreference extends Preference {

  private CharSequence summaryOn;
  private CharSequence summaryOff;
  private boolean isChecked;
  private boolean isCheckedSet;
  private boolean disableDependentsState;

  public TwoStatePreference(Context context) {
    super(context);
  }

  public TwoStatePreference(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public TwoStatePreference(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }

  public TwoStatePreference(Context context, AttributeSet attrs, int defStyleAttr,
      int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
  }

  @Override
  protected void onClick() {
    super.onClick();

    boolean newValue = !isChecked();
    if (callChangeListener(newValue)) {
      setChecked(newValue);
    }
  }

  /**
   * Sets the checked state and saves it to the {@link SharedPreferences}.
   *
   * @param checked
   *     The checked state.
   */
  public void setChecked(boolean checked) {
    // Always persist/notify the first time; don't assume the field's default of false.
    boolean changed = isChecked != checked;
    if (changed || !isCheckedSet) {
      isChecked = checked;
      isCheckedSet = true;
      persistBoolean(checked);
      if (changed) {
        notifyDependencyChange(shouldDisableDependents());
        notifyChanged();
      }
    }
  }

  /**
   * Returns the checked state.
   *
   * @return The checked state.
   */
  public boolean isChecked() {
    return isChecked;
  }

  @Override
  public boolean shouldDisableDependents() {
    boolean shouldDisable = disableDependentsState ? isChecked : !isChecked;
    return shouldDisable || super.shouldDisableDependents();
  }

  /**
   * Sets the summary to be shown when checked.
   *
   * @param summary
   *     The summary to be shown when checked.
   */
  public void setSummaryOn(CharSequence summary) {
    summaryOn = summary;
    if (isChecked()) {
      notifyChanged();
    }
  }

  /**
   * @param summaryResId
   *     The summary as a resource.
   *
   * @see #setSummaryOn(CharSequence)
   */
  public void setSummaryOn(int summaryResId) {
    setSummaryOn(getContext().getString(summaryResId));
  }

  /**
   * Returns the summary to be shown when checked.
   *
   * @return The summary.
   */
  public CharSequence getSummaryOn() {
    return summaryOn;
  }

  /**
   * Sets the summary to be shown when unchecked.
   *
   * @param summary
   *     The summary to be shown when unchecked.
   */
  public void setSummaryOff(CharSequence summary) {
    summaryOff = summary;
    if (!isChecked()) {
      notifyChanged();
    }
  }

  /**
   * @param summaryResId
   *     The summary as a resource.
   *
   * @see #setSummaryOff(CharSequence)
   */
  public void setSummaryOff(int summaryResId) {
    setSummaryOff(getContext().getString(summaryResId));
  }

  /**
   * Returns the summary to be shown when unchecked.
   *
   * @return The summary.
   */
  public CharSequence getSummaryOff() {
    return summaryOff;
  }

  /**
   * Returns whether dependents are disabled when this preference is on ({@code true})
   * or when this preference is off ({@code false}).
   *
   * @return Whether dependents are disabled when this preference is on ({@code true})
   * or when this preference is off ({@code false}).
   */
  public boolean getDisableDependentsState() {
    return disableDependentsState;
  }

  /**
   * Sets whether dependents are disabled when this preference is on ({@code true})
   * or when this preference is off ({@code false}).
   *
   * @param disableDependentsState
   *     The preference state that should disable dependents.
   */
  public void setDisableDependentsState(boolean disableDependentsState) {
    this.disableDependentsState = disableDependentsState;
  }

  @Override
  protected Object onGetDefaultValue(TypedArray a, int index) {
    return a.getBoolean(index, false);
  }

  @Override
  protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
    setChecked(restoreValue ? getPersistedBoolean(isChecked) : (Boolean) defaultValue);
  }

  /**
   * Sync a summary view contained within view's subhierarchy with the correct summary text.
   *
   * @param view
   *     View where a summary should be located
   */
  void syncSummaryView(View view) {
    // Sync the summary view
    boolean useDefaultSummary = true;
    if (isChecked && !isEmpty(summaryOn)) {
      summaryView.setText(summaryOn);
      useDefaultSummary = false;
    } else if (!isChecked && !isEmpty(summaryOff)) {
      summaryView.setText(summaryOff);
      useDefaultSummary = false;
    }

    if (useDefaultSummary) {
      CharSequence summary = getSummary();
      if (!isEmpty(summary)) {
        summaryView.setText(summary);
        useDefaultSummary = false;
      }
    }

    int newVisibility = View.GONE;
    if (!useDefaultSummary) {
      // Someone has written to it
      newVisibility = View.VISIBLE;
    }
    if (newVisibility != summaryView.getVisibility()) {
      summaryView.setVisibility(newVisibility);
    }
  }

  @Override
  protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    if (isPersistent()) {
      // No need to save instance state since it's persistent
      return superState;
    }

    SavedState myState = new SavedState(superState);
    myState.checked = isChecked();
    return myState;
  }

  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // Didn't save state for us in onSaveInstanceState
      super.onRestoreInstanceState(state);
      return;
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    setChecked(myState.checked);
  }

  static class SavedState extends BaseSavedState {

    boolean checked;

    public SavedState(Parcel source) {
      super(source);
      checked = source.readInt() == 1;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
      super.writeToParcel(dest, flags);
      dest.writeInt(checked ? 1 : 0);
    }

    public SavedState(Parcelable superState) {
      super(superState);
    }

    public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {
      public SavedState createFromParcel(Parcel in) {
        return new SavedState(in);
      }

      public SavedState[] newArray(int size) {
        return new SavedState[size];
      }
    };
  }
}



================================================
FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/Typefaces.java
================================================
package com.jenzz.materialpreference;

import android.content.Context;
import android.graphics.Typeface;
import android.util.Log;
import java.util.Hashtable;

final class Typefaces {

  private static final String TAG = Typefaces.class.getSimpleName();
  private static final Hashtable<String, Typeface> cache = new Hashtable<>();

  private Typefaces() {
    // no instances
  }

  static Typeface get(Context context, String assetPath) {
    synchronized (cache) {
      if (!cache.containsKey(assetPath)) {
        try {
          Typeface t = Typeface.createFromAsset(context.getAssets(), assetPath);
          cache.put(assetPath, t);
        } catch (Exception e) {
          Log.e(TAG, "Could not get typeface '" + assetPath + "' Error: " + e.getMessage());
          return null;
        }
      }
      return cache.get(assetPath);
    }
  }

  static Typeface getRobotoRegular(Context context) {
    return get(context, "fonts/Roboto-Regular.ttf");
  }

  static Typeface getRobotoMedium(Context context) {
    return get(context, "fonts/Roboto-Medium.ttf");
  }
}


================================================
FILE: MaterialPreference/src/main/res/layout/mp_checkbox_preference.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/checkbox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:focusable="false"
    android:clickable="false"
    />

================================================
FILE: MaterialPreference/src/main/res/layout/mp_preference.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<com.balysv.materialripple.MaterialRippleLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:mrl_rippleOverlay="true"
    app:mrl_rippleColor="?attr/colorPrimary">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="48dp"
        android:gravity="center_vertical"
        android:paddingLeft="16dp"
        android:paddingRight="16dp"
        android:clipToPadding="false"
        >
        <LinearLayout
            android:id="@+id/icon_frame"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="-4dp"
            android:minWidth="60dp"
            android:gravity="start|center_vertical"
            android:orientation="horizontal"
            android:paddingRight="12dp"
            android:paddingTop="4dp"
            android:paddingBottom="4dp"
            >
            <com.jenzz.materialpreference.PreferenceImageView
                android:id="@+id/icon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:maxWidth="48dp"
                android:maxHeight="48dp"
                />
        </LinearLayout>

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingTop="16dp"
            android:paddingBottom="16dp"
            >

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:textSize="16sp"
                android:textColor="?android:attr/textColorPrimary"
                android:ellipsize="marquee"
                />

            <TextView
                android:id="@+id/summary"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/title"
                android:layout_alignLeft="@id/title"
                android:textSize="14sp"
                android:textColor="?android:attr/textColorSecondary"
                android:maxLines="10"
                />

        </RelativeLayout>

        <LinearLayout
            android:id="@+id/widget_frame"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="end|center_vertical"
            android:paddingLeft="16dp"
            android:orientation="vertical"
            />

    </LinearLayout>
</com.balysv.materialripple.MaterialRippleLayout>


================================================
FILE: MaterialPreference/src/main/res/layout/mp_preference_category.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/title"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:textSize="14sp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    />

================================================
FILE: MaterialPreference/src/main/res/layout/mp_switch_preference.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/switch_compat"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@null"
    android:focusable="false"
    android:clickable="false"
    />

================================================
FILE: MaterialPreference/src/main/res/values/mp_attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>

  <attr name="mp_colorAccent"
      format="reference|color"/>

</resources>

================================================
FILE: Notes.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Notes" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="java-gradle" name="Java-Gradle">
      <configuration>
        <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
        <option name="BUILDABLE" value="false" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.gradle" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

================================================
FILE: README.md
================================================
#ScreenShot
<img src="./screenshot/S50603-103314.jpg" width="30%" height="30%">
<img src="./screenshot/S50605-164248.jpg" width="30%" height="30%">

<img src="./screenshot/S50605-164615.jpg" width="30%" height="30%">
<img src="./screenshot/S50611-163425.jpg" width="30%" height="30%">

<img src="./screenshot/S50611-163752.jpg" width="30%" height="30%">
<img src="./screenshot/S50611-164132.jpg" width="30%" height="30%">

<img src="./screenshot/S50611-164146.jpg" width="30%" height="30%">

#1.1.2
- 增加了多款彩色主题的选择
- 增加了关于界面的分享功能
- 修复了笔记过长的显示问题
- 修复了SwipeRefreshLayout和RecyclerView的组合问题
- 优化界面的一些细节,修复已知的小bug

#1.1.0
- 增加了笔记列表的卡片式的布局,可在设置里面切换
- 增加了下拉同步笔记的组件
- 增加编辑笔记时点击返回询问是否保存
- 使用了Snackbar代替了Toast的提示
- 去除了编辑笔记内容的下划线
- 修改了笔记列表的显示时间方式
- 修复了小米2s 5.0上CardView的显示问题

#1.0.2
- Material Design风格,采用抽屉式菜单,悬浮滑动按钮,点击控件时的水波纹效果,状态栏透明使得与应用融为一体,用户即使在Android L系统以下的手机也能感受到良好的用户体验
- 用文字记录身边随时发生的事情,或者你的待办事项
- 同步,同步需要你在手机设置里面添加一个邮箱,并作为你的同步账号,提交到服务器

#License
```
Copyright 2015 Liaoguipeng

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/app.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Notes" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":app" />
      </configuration>
    </facet>
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="debug" />
        <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
        <option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
        <option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
        <afterSyncTasks>
          <task>generateDebugAndroidTestSources</task>
          <task>generateDebugSources</task>
        </afterSyncTasks>
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/22.2.0/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/22.2.0/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.melnykov/floatingactionbutton/1.3.0/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.nispok/snackbar/2.10.10/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.pnikosis/materialish-progress/1.5/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.rengwuxian.materialedittext/library/2.1.3/jars" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
      <excludeFolder url="file://$MODULE_DIR$/build/reports" />
      <excludeFolder url="file://$MODULE_DIR$/build/test-results" />
      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
    </content>
    <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="library-2.4.0" level="project" />
    <orderEntry type="library" exported="" name="fastjson" level="project" />
    <orderEntry type="library" exported="" name="library-2.1.3" level="project" />
    <orderEntry type="library" exported="" name="eventbus-2.4.0" level="project" />
    <orderEntry type="library" exported="" name="recyclerview-v7-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="dagger-1.2.2" level="project" />
    <orderEntry type="library" exported="" name="libammsdk" level="project" />
    <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="materialish-progress-1.5" level="project" />
    <orderEntry type="library" exported="" name="javax.inject-1" level="project" />
    <orderEntry type="library" exported="" name="floatingactionbutton-1.3.0" level="project" />
    <orderEntry type="library" exported="" name="guava-15.0" level="project" />
    <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
    <orderEntry type="library" exported="" name="butterknife-6.1.0" level="project" />
    <orderEntry type="library" exported="" name="BmobSDK_V3.3.8_0521" level="project" />
    <orderEntry type="library" exported="" name="javawriter-2.5.0" level="project" />
    <orderEntry type="library" exported="" name="systembartint-1.0.3" level="project" />
    <orderEntry type="library" exported="" name="snackbar-2.10.10" level="project" />
    <orderEntry type="library" exported="" name="dagger-compiler-1.2.2" level="project" />
    <orderEntry type="library" exported="" name="cardview-v7-22.2.0" level="project" />
    <orderEntry type="module" module-name="MaterialPreference" exported="" />
    <orderEntry type="module" module-name="orm-library" exported="" />
  </component>
</module>

================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
def packTime() {
    return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("UTC"))
}

def projectUrl = "https://github.com/lguipeng/Notes"
def blogUrl = "http://www.jianshu.com/users/f612d54d668e/latest_articles"
def appDownloadUrl = "http://notes.55058a091d225.d01.nanoyun.com/release/notes.apk"
def aboutAppUrl = "http://www.jianshu.com/p/640a7f2fe0c5"

//remember to add your bmob app key in local.properties
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def bmobAppKey = properties.getProperty('BMOB_KEY')
def weChatId = properties.getProperty('WECHAT_ID')
android {
    signingConfigs {
        debug {

        }
        release {
            //setting your signing.properties
            //first, add signing.properties to ./app/
            //second, add property STORE_FILE, STORE_PASSWORD, KEY_ALIAS, KEY_PASSWORD
        }
    }
    compileSdkVersion Integer.parseInt(ANDROID_BUILD_COMPILE_SDK_VERSION)
    buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
    defaultConfig {
        applicationId "com.lguipeng.notes"
        minSdkVersion Integer.parseInt(MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
        versionCode Integer.parseInt(VERSION_CODE)
        versionName VERSION_NAME

        buildConfigField "String", "BMOB_KEY", "\"${bmobAppKey}\""
        buildConfigField "String", "WECHAT_ID", "\"${weChatId}\""
        buildConfigField "String", "APP_DOWNLOAD_URL", "\"${appDownloadUrl}\""
        buildConfigField "String", "PROJECT_URL", "\"${projectUrl}\""
        buildConfigField "String", "BLOG_URL", "\"${blogUrl}\""
        buildConfigField "String", "ABOUT_APP_URL", "\"${aboutAppUrl}\""
    }
    buildTypes {

        debug {
            versionNameSuffix " Beta"
            minifyEnabled false
            zipAlignEnabled false
            shrinkResources false
            signingConfig signingConfigs.debug
        }
        release {
            minifyEnabled false
            zipAlignEnabled false
            shrinkResources true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        abortOnError false
    }

    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def outputFile = output.outputFile
            if (outputFile != null && outputFile.name.endsWith('.apk')) {
                File outputDirectory = new File(outputFile.parent);
                def fileName
                if (variant.buildType.name == "release") {
                    fileName = "notes_v${defaultConfig.versionName}_${packTime()}.apk"
                }else{
                    fileName = "notes_beta.apk"
                }
                output.outputFile = new File(outputDirectory, fileName)
            }
        }

    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:recyclerview-v7:22.2.0'
    compile 'com.android.support:cardview-v7:22.2.0'
    compile 'com.jakewharton:butterknife:6.1.0'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    compile 'com.rengwuxian.materialedittext:library:2.1.3'
    compile 'com.squareup.dagger:dagger:1.2.2'
    provided 'com.squareup.dagger:dagger-compiler:1.2.2'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.pnikosis:materialish-progress:1.5'
    compile 'com.nispok:snackbar:2.10.10'
    compile project(':orm-library')
    compile project(':MaterialPreference')
}

File propFile = file('signing.properties');
if (propFile.exists()) {
    def Properties props = new Properties()
    props.load(new FileInputStream(propFile))
    if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
            props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
        android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
        android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
        android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
        android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
    } else {
        android.buildTypes.release.signingConfig = null
    }
} else {
    android.buildTypes.release.signingConfig = null
}

================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in E:\adt-bundle-windows-x86_64-20131030/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}


================================================
FILE: app/src/androidTest/java/com/lguipeng/notes/ApplicationTest.java
================================================
package com.lguipeng.notes;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.lguipeng.notes">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <application
        android:name=".App"
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:theme="@style/RedTheme">

        <activity
            android:name=".ui.MainActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.SettingActivity"
            android:screenOrientation="portrait"
            android:launchMode="singleTop">
        </activity>

        <activity
            android:name=".ui.NoteActivity"
            android:launchMode="singleTop"
            android:windowSoftInputMode="adjustResize|stateHidden"
            android:screenOrientation="portrait">

        </activity>
        <activity
            android:name=".ui.AboutActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
        </activity>

        <activity
            android:name=".ui.PayActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
        </activity>

        <activity
            android:name=".ui.EditNoteTypeActivity"
            android:windowSoftInputMode="adjustResize"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
        </activity>
    </application>

</manifest>


================================================
FILE: app/src/main/java/com/lguipeng/notes/App.java
================================================
package com.lguipeng.notes;

import android.app.Application;

import com.lguipeng.notes.module.AppModule;

import java.util.Arrays;
import java.util.List;

import cn.bmob.v3.Bmob;
import dagger.ObjectGraph;

/**
 * Created by lgp on 2015/5/24.
 */
public class App extends Application{
    private ObjectGraph objectGraph;
    @Override
    public void onCreate() {
        super.onCreate();
        objectGraph = ObjectGraph.create(getModules().toArray());
        objectGraph.inject(this);
        Bmob.initialize(this, BuildConfig.BMOB_KEY);
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
    }

    private List<Object> getModules() {
        return Arrays.<Object>asList(new AppModule(this));
    }

    public ObjectGraph createScopedGraph(Object... modules) {
        return objectGraph.plus(modules);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/BaseListAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@SuppressLint("UseSparseArrays")
public abstract class BaseListAdapter<E> extends BaseAdapter {

	public List<E> list;

	public Context mContext;

	public LayoutInflater mInflater;

	public List<E> getList() {
		return list;
	}

	public void setList(List<E> list) {
		this.list = list;
		notifyDataSetChanged();
	}

	public void add(E e) {
		this.list.add(e);
		notifyDataSetChanged();
	}

	public void addAll(List<E> list) {
		this.list.addAll(list);
		notifyDataSetChanged();
	}

	public void remove(int position) {
		this.list.remove(position);
		notifyDataSetChanged();
	}

	public BaseListAdapter(Context context, List<E> list) {
		super();
		this.mContext = context;
		this.list = list;
		mInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public E getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = bindView(position, convertView, parent);
		addInternalClickListener(convertView, position, list.get(position));
		return convertView;
	}

	public abstract View bindView(int position, View convertView,
			ViewGroup parent);

	public Map<Integer, onInternalClickListener<E>> canClickItem;

	private void addInternalClickListener(final View itemV, final Integer position, final E valuesMap) {
		if (canClickItem != null) {
			for (Integer key : canClickItem.keySet()) {
				View inView = itemV.findViewById(key);
				final onInternalClickListener<E> listener = canClickItem.get(key);
				if (inView != null && listener != null) {
					inView.setOnClickListener(new OnClickListener() {

						public void onClick(View v) {
							listener.OnClickListener(itemV, v, position,
                                    valuesMap);
						}
					});
                    inView.setOnLongClickListener(new View.OnLongClickListener() {
                        @Override
                        public boolean onLongClick(View v) {
                            listener.OnLongClickListener(itemV, v, position,
                                    valuesMap);
                            return true;
                        }
                    });
				}
			}
		}
	}

	public void setOnInViewClickListener(Integer key,
			onInternalClickListener<E> onClickListener) {
		if (canClickItem == null)
			canClickItem = new HashMap<>();
		canClickItem.put(key, onClickListener);
	}

	public interface onInternalClickListener<T> {
		void OnClickListener(View parentV, View v, Integer position,
									T values);
		void OnLongClickListener(View parentV, View v, Integer position,
										T values);
	}

    public static class onInternalClickListenerImpl<T> implements onInternalClickListener<T>{
        @Override
        public void OnClickListener(View parentV, View v, Integer position, T values) {

        }

        @Override
        public void OnLongClickListener(View parentV, View v, Integer position, T values) {

        }
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/BaseRecyclerViewAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.animation.Animator;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;

import com.lguipeng.notes.utils.ViewHelper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by lgp on 2015/5/24.
 */
public abstract class BaseRecyclerViewAdapter<E> extends RecyclerView.Adapter<RecyclerView.ViewHolder>{

    protected Context mContext;

    private int mDuration = 300;

    private Interpolator mInterpolator = new LinearInterpolator();

    private int mLastPosition = -1;

    private boolean isFirstOnly = true;

    protected List<E> list;
    private Map<Integer, onInternalClickListener<E>> canClickItem;
    public BaseRecyclerViewAdapter(List<E> list) {
        this(list, null);
    }

    public BaseRecyclerViewAdapter(List<E> list, Context context) {
        this.list = list;
        this.mContext = context;
    }

    public void add(E e) {
        this.list.add(0, e);
        notifyItemInserted(0);
    }

    public void remove(E e) {
        this.list.remove(e);
        notifyDataSetChanged();
    }

    public void remove(int position) {
        this.list.remove(position);
        notifyDataSetChanged();
    }


    public void setList(List<E> list) {
        this.list.clear();
        this.list.addAll(list);
        notifyDataSetChanged();
    }

    public List<E> getList() {
        return list;
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return null;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder != null){
            addInternalClickListener(holder.itemView, position, list.get(position));
        }
    }

    @Override
    public int getItemViewType(int position) {
        return 1;
    }

    private void addInternalClickListener(final View itemV, final Integer position, final E valuesMap) {
        if (canClickItem != null) {
            for (Integer key : canClickItem.keySet()) {
                View inView = itemV.findViewById(key);
                final onInternalClickListener<E> listener = canClickItem.get(key);
                if (inView != null && listener != null) {
                    inView.setOnClickListener(new View.OnClickListener() {
                        public void onClick(View v) {
                            listener.OnClickListener(itemV, v, position,
                                    valuesMap);

                        }
                    });
                    inView.setOnLongClickListener(new View.OnLongClickListener() {
                        @Override
                        public boolean onLongClick(View v) {
                            listener.OnLongClickListener(itemV, v, position,
                                    valuesMap);
                            return true;
                        }
                    });
                }
            }
        }
    }

    public void setOnInViewClickListener(Integer key, onInternalClickListener<E> onClickListener) {
        if (canClickItem == null)
            canClickItem = new HashMap<>();
        canClickItem.put(key, onClickListener);
    }

    public interface onInternalClickListener<T> {
        void OnClickListener(View parentV, View v, Integer position,
                                    T values);
        void OnLongClickListener(View parentV, View v, Integer position,
                                        T values);
    }

    public static class onInternalClickListenerImpl<T> implements onInternalClickListener<T>{
        @Override
        public void OnClickListener(View parentV, View v, Integer position, T values) {

        }

        @Override
        public void OnLongClickListener(View parentV, View v, Integer position, T values) {

        }
    }

    public void setDuration(int duration) {
        mDuration = duration;
    }

    public void setInterpolator(Interpolator interpolator) {
        mInterpolator = interpolator;
    }

    public void setStartPosition(int start) {
        mLastPosition = start;
    }

    public void setFirstOnly(boolean firstOnly) {
        isFirstOnly = firstOnly;
    }

    protected void animate(RecyclerView.ViewHolder holder, int position){
        if (!isFirstOnly || position > mLastPosition) {
            for (Animator anim : getAnimators(holder.itemView)) {
                anim.setDuration(mDuration).start();
                anim.setInterpolator(mInterpolator);

            }
            mLastPosition = position;
        } else {
            ViewHelper.clear(holder.itemView);
        }
    }

    protected abstract Animator[] getAnimators(View view);
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/ColorsListAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.lguipeng.notes.R;

import java.util.List;

/**
 * Created by lgp on 2015/6/7.
 */
public class ColorsListAdapter extends BaseListAdapter<Integer>{

    private int checkItem;

    public ColorsListAdapter(Context context, List<Integer> list) {
        super(context, list);
    }

    @Override
    public View bindView(int position, View convertView, ViewGroup parent) {
        Holder holder;
        if (convertView == null){
            convertView = LayoutInflater.from(mContext).inflate(R.layout.colors_image_layout, null);
            holder = new Holder();
            holder.imageView1 = (ImageView)convertView.findViewById(R.id.img_1);
            holder.imageView2 = (ImageView)convertView.findViewById(R.id.img_2);
            convertView.setTag(holder);
        }else{
            holder = (Holder)convertView.getTag();
        }
        holder.imageView1.setImageResource(list.get(position));
        if (checkItem == position){
            holder.imageView2.setImageResource(R.drawable.ic_done_white);
        }
        return convertView;
    }

    public int getCheckItem() {
        return checkItem;
    }

    public void setCheckItem(int checkItem) {
        this.checkItem = checkItem;
    }

    static class Holder {
        ImageView imageView1;
        ImageView imageView2;
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/DrawerListAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.content.Context;

import com.lguipeng.notes.R;

import java.util.List;

/**
 * Created by lgp on 2015/5/24.
 */
public class DrawerListAdapter extends SimpleListAdapter{

    public DrawerListAdapter(Context mContext, List<String> list) {
        super(mContext, list);
    }

    @Override
    protected int getLayout() {
        return R.layout.drawer_list_item_layout;
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/MaterialSimpleListAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.lguipeng.notes.R;
import com.lguipeng.notes.model.MaterialSimpleListItem;

/**
 * Created by lgp on 2015/6/10.
 */
public class MaterialSimpleListAdapter extends ArrayAdapter<MaterialSimpleListItem> {

    public MaterialSimpleListAdapter(Context context) {
        super(context, R.layout.md_simplelist_item, android.R.id.title);
    }

    @Override
    public View getView(final int index, View convertView, ViewGroup parent) {
        final View view = super.getView(index, convertView, parent);
        final MaterialSimpleListItem item = getItem(index);
        ImageView ic = (ImageView) view.findViewById(android.R.id.icon);
        if (item.getIcon() != null)
            ic.setImageDrawable(item.getIcon());
        else
            ic.setVisibility(View.GONE);
        TextView tv = (TextView) view.findViewById(android.R.id.title);
        tv.setText(item.getContent());
        return view;
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/NotesAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Filter;
import android.widget.Filterable;

import com.lguipeng.notes.R;
import com.lguipeng.notes.model.Note;
import com.lguipeng.notes.utils.TimeUtils;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * Created by lgp on 2015/4/6.
 */
public class NotesAdapter extends BaseRecyclerViewAdapter<Note> implements Filterable{
    private final List<Note> originalList;
    private int upDownFactor = 1;
    private boolean isShowScaleAnimate = true;
    public NotesAdapter(List<Note> list) {
        super(list);
        originalList = new ArrayList<>(list);
    }

    public NotesAdapter(List<Note> list, Context context) {
        super(list, context);
        originalList = new ArrayList<>(list);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        Context context = parent.getContext();
        final View view = LayoutInflater.from(context).inflate(R.layout.notes_item_layout, parent, false);
        return new NotesItemViewHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
        super.onBindViewHolder(viewHolder, position);
        NotesItemViewHolder holder = (NotesItemViewHolder) viewHolder;
        Note note = list.get(position);
        if (note == null)
            return;
        holder.setLabelText(note.getLabel());
        holder.setContentText(note.getContent());
        holder.setTimeText(TimeUtils.getConciseTime(note.getLastOprTime(), mContext));
        animate(viewHolder, position);
    }

    @Override
    public Filter getFilter() {
        return new NoteFilter(this, originalList);
    }

    @Override
    protected Animator[] getAnimators(View view) {
        if (view.getMeasuredHeight() <=0 || isShowScaleAnimate){
            ObjectAnimator scaleX = ObjectAnimator.ofFloat(view, "scaleX", 1.1f, 1f);
            ObjectAnimator scaleY = ObjectAnimator.ofFloat(view, "scaleY", 1.1f, 1f);
            return new ObjectAnimator[]{scaleX, scaleY};
        }
        return new Animator[]{
                ObjectAnimator.ofFloat(view, "scaleX", 1.1f, 1f),
                ObjectAnimator.ofFloat(view, "scaleY", 1.1f, 1f),
                ObjectAnimator.ofFloat(view, "translationY", upDownFactor * 1.5f * view.getMeasuredHeight(), 0)
        };
    }

    @Override
    public void setList(List<Note> list) {
        super.setList(list);
        this.originalList.clear();
        originalList.addAll(list);
        setUpFactor();
        isShowScaleAnimate = true;
    }

    public void setDownFactor(){
        upDownFactor = -1;
        isShowScaleAnimate = false;
    }

    public void setUpFactor(){
        upDownFactor = 1;
        isShowScaleAnimate = false;
    }

    private static class NoteFilter extends Filter{

        private final NotesAdapter adapter;

        private final List<Note> originalList;

        private final List<Note> filteredList;

        private NoteFilter(NotesAdapter adapter, List<Note> originalList) {
            super();
            this.adapter = adapter;
            this.originalList = new LinkedList<>(originalList);
            this.filteredList = new ArrayList<>();
        }

        @Override
        protected FilterResults performFiltering(CharSequence constraint) {
            filteredList.clear();
            final FilterResults results = new FilterResults();
            if (constraint.length() == 0) {
                filteredList.addAll(originalList);
            } else {
                for ( Note note : originalList) {
                    if (note.getContent().contains(constraint) || note.getLabel().contains(constraint)) {
                        filteredList.add(note);
                    }
                }
            }
            results.values = filteredList;
            results.count = filteredList.size();
            return results;
        }

        @Override
        protected void publishResults(CharSequence constraint, FilterResults results) {
            adapter.list.clear();
            adapter.list.addAll((ArrayList<Note>) results.values);
            adapter.notifyDataSetChanged();
        }
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/NotesItemViewHolder.java
================================================
package com.lguipeng.notes.adpater;

import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.lguipeng.notes.R;

/**
 * Created by lgp on 2015/4/6.
 */
public class NotesItemViewHolder extends RecyclerView.ViewHolder{

    private final TextView mNoteLabelTextView;
    private final TextView mNoteContentTextView;
    private final TextView mNoteTimeTextView;
    public NotesItemViewHolder(View parent) {
        super(parent);
        mNoteLabelTextView = (TextView) parent.findViewById(R.id.note_label_text);
        mNoteContentTextView = (TextView) parent.findViewById(R.id.note_content_text);
        mNoteTimeTextView = (TextView) parent.findViewById(R.id.note_last_edit_text);
    }

    public void setLabelText(CharSequence text){
        setTextView(mNoteLabelTextView, text);
    }

    public void setLabelText(int text){
        setTextView(mNoteLabelTextView, text);
    }

    public void setContentText(CharSequence text){
        setTextView(mNoteContentTextView, text);
    }

    public void setContentText(int text){
        setTextView(mNoteContentTextView, text);
    }

    public void setTimeText(CharSequence text){
        setTextView(mNoteTimeTextView, text);
    }

    public void setTimeText(int text){
        setTextView(mNoteTimeTextView, text);
    }

    private void setTextView(TextView view, CharSequence text){
        if (view == null || TextUtils.isEmpty(text))
            return;
        view.setText(text);
    }

    private void setTextView(TextView view, int text){
        if (view == null || text <= 0)
            return;
        view.setText(text);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/adpater/SimpleListAdapter.java
================================================
package com.lguipeng.notes.adpater;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lguipeng.notes.R;

import java.util.List;

/**
 * Created by lgp on 2014/8/27.
 */
public abstract class SimpleListAdapter extends BaseListAdapter<String> {

    public SimpleListAdapter(Context mContext, List<String> list) {
        super(mContext, list);
    }

    @Override
    public View bindView(int position, View convertView, ViewGroup parent) {
        Holder holder;
        if (convertView == null){
            convertView = LayoutInflater.from(mContext).inflate(getLayout(), null);
            holder = new Holder();
            holder.textView = (TextView)convertView.findViewById(R.id.textView);
            convertView.setTag(holder);
        }else{
            holder = (Holder)convertView.getTag();
        }
        holder.textView.setText(list.get(position));
        return convertView;
    }

    protected abstract int getLayout();

    static class Holder {
        TextView textView;
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/FindListenerImpl.java
================================================
package com.lguipeng.notes.listener.bmob;

import com.lguipeng.notes.utils.NotesLog;

import java.util.List;

import cn.bmob.v3.listener.FindListener;

/**
 * Created by lgp on 2015/5/30.
 */
public class FindListenerImpl<T> extends FindListener<T> {
    @Override
    public void onSuccess(List<T> list) {

    }

    @Override
    public void onError(int i, String s) {
        NotesLog.e(s);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/SaveListenerImpl.java
================================================
package com.lguipeng.notes.listener.bmob;

import com.lguipeng.notes.utils.NotesLog;

import cn.bmob.v3.listener.SaveListener;

/**
 * Created by lgp on 2015/5/30.
 */
public class SaveListenerImpl extends SaveListener {
    @Override
    public void onSuccess() {

    }

    @Override
    public void onFailure(int i, String s) {
        NotesLog.e(s);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/UpdateListenerImpl.java
================================================
package com.lguipeng.notes.listener.bmob;

import com.lguipeng.notes.utils.NotesLog;

import cn.bmob.v3.listener.UpdateListener;

/**
 * Created by lgp on 2015/5/30.
 */
public class UpdateListenerImpl extends UpdateListener {
    @Override
    public void onSuccess() {

    }

    @Override
    public void onFailure(int i, String s) {
        NotesLog.e(s);

    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/listener/view/RecyclerViewClickListener.java
================================================
package com.lguipeng.notes.listener.view;

import android.view.View;

/**
 * Interface definition for a callback to be invoked when an item in a
 * RecyclerView has been clicked.
 */
public interface RecyclerViewClickListener {

    /**
     * Callback method to be invoked when a item in a
     * RecyclerView is clicked
     *  @param v The view within the RecyclerView.Adapter
     * @param position The position of the view in the adapter
     * @param x
     * @param y
     */
    void onClick(View v, int position, float x, float y);
}

================================================
FILE: app/src/main/java/com/lguipeng/notes/model/CloudNote.java
================================================
package com.lguipeng.notes.model;

import com.lguipeng.notes.utils.JsonUtils;

import java.util.ArrayList;
import java.util.List;

import cn.bmob.v3.BmobObject;

/**
 * Created by lgp on 2015/5/28.
 */
public class CloudNote extends BmobObject {

    public CloudNote() {
        this("CloudNote");
    }

    public CloudNote(String theClassName) {
        super(theClassName);
    }

    private String email;

    private List<String> noteList = new ArrayList<>();

    private String noteType;

    private long version;

    public long getVersion() {
        return version;
    }

    public void setVersion(long version) {
        this.version = version;
    }

    public String getNoteType() {
        return noteType;
    }

    public void setNoteType(String noteType) {
        this.noteType = noteType;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<String> getNoteList() {
        return noteList;
    }

    public void setNoteList(List<String> noteList) {
        this.noteList = noteList;
    }

    public void addNote(Note note) {
        noteList.add(JsonUtils.jsonNote(note));
    }

    public void clearNotes() {
        noteList.clear();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        //sb.append(super.toString());
        //sb.append("\n");
        for (String note : noteList){
            sb.append(note);
            sb.append("\n");
        }
        return sb.toString();
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/model/MaterialSimpleListItem.java
================================================
package com.lguipeng.notes.model;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;

/**
 * Created by lgp on 2015/6/10.
 */
public class MaterialSimpleListItem {

    private Builder mBuilder;

    private MaterialSimpleListItem(Builder builder) {
        mBuilder = builder;
    }

    public Drawable getIcon() {
        return mBuilder.mIcon;
    }

    public CharSequence getContent() {
        return mBuilder.mContent;
    }

    public static class Builder {

        private Context mContext;
        protected Drawable mIcon;
        protected CharSequence mContent;

        public Builder(Context context) {
            mContext = context;
        }

        public Builder icon(Drawable icon) {
            this.mIcon = icon;
            return this;
        }

        public Builder icon(@DrawableRes int iconRes) {
            if (iconRes == 0)
                return this;
            return icon(ContextCompat.getDrawable(mContext, iconRes));
        }

        public Builder content(CharSequence content) {
            this.mContent = content;
            return this;
        }

        public Builder content(@StringRes int contentRes) {
            return content(mContext.getString(contentRes));
        }

        public MaterialSimpleListItem build() {
            return new MaterialSimpleListItem(this);
        }
    }

    @Override
    public String toString() {
        if (getContent() != null)
            return getContent().toString();
        else return "(no content)";
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/model/Note.java
================================================
package com.lguipeng.notes.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.lguipeng.notes.utils.JsonUtils;

import net.tsz.afinal.annotation.sqlite.OneToMany;
import net.tsz.afinal.annotation.sqlite.Table;
import net.tsz.afinal.db.sqlite.OneToManyLazyLoader;

import java.io.Serializable;

/**
 * Created by lgp on 2015/5/25.
 */
@Table(name = "notes")
public class Note implements Serializable{
    @JSONField(serialize=false, deserialize=false)
    private int id;
    private int type;
    private String label;
    private String content;
    private long lastOprTime;
    @JSONField(serialize=false, deserialize=false)
    @OneToMany(manyColumn = "noteId")
    private OneToManyLazyLoader<Note ,NoteOperateLog> logs;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getLastOprTime() {
        return lastOprTime;
    }

    public void setLastOprTime(long lastOprTime) {
        this.lastOprTime = lastOprTime;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public OneToManyLazyLoader<Note, NoteOperateLog> getLogs() {
        return logs;
    }

    public void setLogs(OneToManyLazyLoader<Note, NoteOperateLog> logs) {
        this.logs = logs;
    }

    @Override
    public String toString() {
        return JsonUtils.jsonNote(this);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/model/NoteOperateLog.java
================================================
package com.lguipeng.notes.model;

import net.tsz.afinal.annotation.sqlite.ManyToOne;
import net.tsz.afinal.annotation.sqlite.Table;

import java.io.Serializable;

/**
 * Created by lgp on 2015/5/25.
 */
@Table(name = "note_opr_log")
public class NoteOperateLog implements Serializable {
    private int id;
    private int type;
    private long time;
    @ManyToOne(column = "noteId")
    private Note note;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public Note getNote() {
        return note;
    }

    public void setNote(Note note) {
        this.note = note;
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/model/NoteType.java
================================================
package com.lguipeng.notes.model;

import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lgp on 2015/6/2.
 */
public class NoteType{

    @JSONField(serialize=false, deserialize=false)
    public final static int ALL_COUNT = 4;

    private List<String> types = new ArrayList<>();

    public void addType(String type){
        if (types != null && types.size() < ALL_COUNT && !TextUtils.isEmpty(type)){
            types.add(type);
        }
    }

    public String getType(int location){
        if (types != null && types.size() > location){
            return types.get(location);
        }
        return "";
    }

    public List<String> getTypes() {
        return types;
    }

    public void setTypes(List<String> types) {
        this.types = types;
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/module/AppModule.java
================================================
package com.lguipeng.notes.module;

import android.app.Application;
import android.content.Context;

import com.lguipeng.notes.App;

import dagger.Module;
import dagger.Provides;

/**
 * Created by lgp on 2015/5/26.
 */
@Module(
        injects = {
                App.class
        },
        library = true
)
public class AppModule {
    private App app;

    public AppModule(App app) {
        this.app = app;
    }

    @Provides
    Application provideApplication() {
        return app;
    }

    @Provides
    Context provideContext() {
        return app.getApplicationContext();
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/module/DataModule.java
================================================
package com.lguipeng.notes.module;

import android.content.Context;

import com.lguipeng.notes.ui.AboutActivity;
import com.lguipeng.notes.ui.EditNoteTypeActivity;
import com.lguipeng.notes.ui.MainActivity;
import com.lguipeng.notes.ui.NoteActivity;
import com.lguipeng.notes.ui.PayActivity;
import com.lguipeng.notes.ui.SettingActivity;
import com.lguipeng.notes.ui.fragments.SettingFragment;

import net.tsz.afinal.FinalDb;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by lgp on 2015/5/26.
 */
@Module(
        injects = {
                AboutActivity.class,
                MainActivity.class,
                NoteActivity.class,
                SettingActivity.class,
                SettingFragment.class,
                PayActivity.class,
                EditNoteTypeActivity.class
        },
        addsTo = AppModule.class,
        library = true
)
public class DataModule {

    @Provides @Singleton
    FinalDb.DaoConfig provideDaoConfig(Context context) {
        FinalDb.DaoConfig config = new FinalDb.DaoConfig();
        config.setDbName("notes.db");
        config.setDbVersion(1);
        config.setDebug(true);
        config.setContext(context);
        return config;
    }

    @Provides @Singleton
    FinalDb provideFinalDb(FinalDb.DaoConfig config) {
        return FinalDb.create(config);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/AboutActivity.java
================================================
package com.lguipeng.notes.ui;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.lguipeng.notes.BuildConfig;
import com.lguipeng.notes.R;
import com.lguipeng.notes.adpater.MaterialSimpleListAdapter;
import com.lguipeng.notes.model.MaterialSimpleListItem;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.utils.SnackbarUtils;
import com.lguipeng.notes.utils.TimeUtils;
import com.lguipeng.notes.utils.WXUtils;
import com.tencent.mm.sdk.modelmsg.SendMessageToWX;
import com.tencent.mm.sdk.modelmsg.WXMediaMessage;
import com.tencent.mm.sdk.modelmsg.WXWebpageObject;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

import java.util.Arrays;
import java.util.List;

import butterknife.InjectView;
import butterknife.OnClick;

/**
 * Created by lgp on 2015/5/25.
 */
public class AboutActivity extends BaseActivity implements View.OnClickListener{
    @InjectView(R.id.toolbar)
    Toolbar toolbar;
    @InjectView(R.id.version_text)
    TextView versionTextView;
    @InjectView(R.id.blog_btn)
    Button blogButton;
    @InjectView(R.id.project_home_btn)
    Button projectHomeButton;
    private int clickCount = 0;
    private long lastClickTime = 0;
    private final static String WEIBO_PACKAGENAME = "com.sina.weibo";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initVersionText();
        blogButton.setOnClickListener(this);
        projectHomeButton.setOnClickListener(this);
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_about;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.blog_btn:
                startViewAction(BuildConfig.BLOG_URL);
                break;
            case R.id.project_home_btn:
                startViewAction(BuildConfig.PROJECT_URL);
                break;
            default:
                break;
        }
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
        toolbar.setTitle(R.string.about);

    }

    @OnClick(R.id.version_text)
    void versionClick(View view){
        if (clickCount < 3){
            if (TimeUtils.getCurrentTimeInLong() - lastClickTime < 500 || lastClickTime <= 0){
                clickCount ++;
                if (clickCount >= 3){
                    startViewAction(BuildConfig.ABOUT_APP_URL);
                    clickCount = 0;
                    lastClickTime = 0;
                    return;
                }
            }else {
                clickCount = 0;
                lastClickTime = 0;
                return;
            }
            lastClickTime = TimeUtils.getCurrentTimeInLong();
        }
    }

    private void initVersionText(){
        versionTextView.setText("v" + getVersion(this));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_about, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case R.id.share:
               showShareDialog();
                break;
            default:
                return super.onOptionsItemSelected(item);
        }
        return true;
    }

    private String getVersion(Context ctx){
        try {
            PackageManager pm = ctx.getPackageManager();
            PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), PackageManager.GET_ACTIVITIES);
            return pi.versionName;
        }catch (PackageManager.NameNotFoundException e)
        {
            e.printStackTrace();
        }
        return "1.0.0";
    }

    private void startViewAction(String uriStr){
        try {
            Uri uri = Uri.parse(uriStr);
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(intent);
        } catch (ActivityNotFoundException e) {
            e.printStackTrace();
        }
    }

    private void share(String packages, Uri uri){
        Intent intent=new Intent(Intent.ACTION_SEND);
        if (uri != null){
            intent.setType("image/*");
            intent.putExtra(Intent.EXTRA_STREAM, uri);
        }else {
            intent.setType("text/plain");
        }
        intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share));
        intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text, getString(R.string.download_url), BuildConfig.APP_DOWNLOAD_URL));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        if (!TextUtils.isEmpty(packages))
            intent.setPackage(packages);
        startActivity(Intent.createChooser(intent, getString(R.string.share)));
    }

    private byte[] getLogoBitmapArray(){
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
        return WXUtils.bmpToByteArray(bitmap, false);
    }

    private void shareToWeChat(int scene){
        IWXAPI api = WXAPIFactory.createWXAPI(this, BuildConfig.WECHAT_ID, true);
        if (!api.isWXAppInstalled()){
            SnackbarUtils.show(this, R.string.not_install_app);
        }
        api.registerApp(BuildConfig.WECHAT_ID);
        WXWebpageObject object = new WXWebpageObject();
        object.webpageUrl = "http://www.wandoujia.com/apps/com.lguipeng.notes";
        WXMediaMessage msg = new WXMediaMessage(object);
        msg.mediaObject = object;
        msg.thumbData = getLogoBitmapArray();
        msg.title = getString(R.string.app_desc);
        msg.description = getString(R.string.share_text, "", "");
        SendMessageToWX.Req request = new SendMessageToWX.Req();
        request.message = msg;
        request.scene = scene;
        api.sendReq(request);
        api.unregisterApp();
    }

    private void shareToWeChatTimeline(){
        shareToWeChat(SendMessageToWX.Req.WXSceneTimeline);
    }

    private void shareToWeChatSession(){
        shareToWeChat(SendMessageToWX.Req.WXSceneSession);
    }

    private void shareToWeChatFavorite(){
        shareToWeChat(SendMessageToWX.Req.WXSceneFavorite);
    }

    private void shareToWeibo(){
        if (isInstallApplication(WEIBO_PACKAGENAME)){
            share(WEIBO_PACKAGENAME, null);
        }else {
            SnackbarUtils.show(this, R.string.not_install_app);
        }
    }

    private boolean isInstallApplication(String packageName){
        try {
            PackageManager pm = this.getPackageManager();
            pm.getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES);
            return true;
        } catch (PackageManager.NameNotFoundException e) {
            return false;
        }
    }

    private void showShareDialog(){
        AlertDialog.Builder builder = generateDialogBuilder();
        builder.setTitle(getString(R.string.share));
        final MaterialSimpleListAdapter adapter = new MaterialSimpleListAdapter(this);
        String[] array = getResources().getStringArray(R.array.share_dialog_text);
        adapter.add(new MaterialSimpleListItem.Builder(this)
                .content(array[0])
                .icon(R.drawable.ic_wx_logo)
                .build());
        adapter.add(new MaterialSimpleListItem.Builder(this)
                .content(array[1])
                .icon(R.drawable.ic_wx_moments)
                .build());
        adapter.add(new MaterialSimpleListItem.Builder(this)
                .content(array[2])
                .icon(R.drawable.ic_wx_collect)
                .build());
        adapter.add(new MaterialSimpleListItem.Builder(this)
                .content(array[3])
                .icon(R.drawable.ic_sina_logo)
                .build());
        adapter.add(new MaterialSimpleListItem.Builder(this)
                .content(array[4])
                .icon(R.drawable.ic_share_more)
                .build());
        builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                switch (which){
                    case 0:
                        shareToWeChatSession();
                        break;
                    case 1:
                        shareToWeChatTimeline();
                        break;
                    case 2:
                        shareToWeChatFavorite();
                        break;
                    case 3:
                        shareToWeibo();
                        break;
                    default:
                        share("", null);
                }
            }
        });
        builder.show();
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/BaseActivity.java
================================================
package com.lguipeng.notes.ui;

import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.WindowManager;

import com.lguipeng.notes.App;
import com.lguipeng.notes.R;
import com.lguipeng.notes.utils.PreferenceUtils;
import com.lguipeng.notes.utils.ThemeUtils;
import com.readystatesoftware.systembartint.SystemBarTintManager;

import java.util.List;

import butterknife.ButterKnife;
import dagger.ObjectGraph;

/**
 * Created by lgp on 2015/5/24.
 */
public abstract class BaseActivity extends AppCompatActivity {

    private ObjectGraph activityGraph;

    protected PreferenceUtils preferenceUtils;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        preferenceUtils = PreferenceUtils.getInstance(this);
        initTheme();
        super.onCreate(savedInstanceState);
        initWindow();
        activityGraph = ((App) getApplication()).createScopedGraph(getModules().toArray());
        activityGraph.inject(this);
        setContentView(getLayoutView());
        ButterKnife.inject(this);
        initToolbar();
    }

    private void initTheme(){
        ThemeUtils.Theme theme = getCurrentTheme();
        ThemeUtils.changTheme(this, theme);
    }

    protected int getColor(int res){
        if (res <= 0)
            throw new IllegalArgumentException("resource id can not be less 0");
        return getResources().getColor(res);
    }

    @TargetApi(19)
    private void initWindow(){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            tintManager.setStatusBarTintColor(getStatusBarColor());
            tintManager.setStatusBarTintEnabled(true);
        }
    }

    protected void initToolbar(Toolbar toolbar){
        if (toolbar == null)
            return;
        toolbar.setBackgroundColor(getColorPrimary());
        toolbar.setTitle(R.string.app_name);
        toolbar.setTitleTextColor(getColor(R.color.action_bar_title_color));
        toolbar.collapseActionView();
        setSupportActionBar(toolbar);
        if (getSupportActionBar() != null){
            getSupportActionBar().setHomeAsUpIndicator(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }

    public int getStatusBarColor(){
        return getColorPrimary();
    }

    public int getColorPrimary(){
        TypedValue typedValue = new  TypedValue();
        getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
        return typedValue.data;
    }

    public int getDarkColorPrimary(){
        TypedValue typedValue = new  TypedValue();
        getTheme().resolveAttribute(R.attr.colorPrimaryDark, typedValue, true);
        return typedValue.data;
    }

    protected AlertDialog.Builder generateDialogBuilder(){
        ThemeUtils.Theme theme = getCurrentTheme();
        AlertDialog.Builder builder;
        int style = R.style.RedDialogTheme;
        switch (theme){
            case BROWN:
                style = R.style.BrownDialogTheme;
                break;
            case BLUE:
                style = R.style.BlueDialogTheme;
                break;
            case BLUE_GREY:
                style = R.style.BlueGreyDialogTheme;
                break;
            case YELLOW:
                style = R.style.YellowDialogTheme;
                break;
            case DEEP_PURPLE:
                style = R.style.DeepPurpleDialogTheme;
                break;
            case PINK:
                style = R.style.PinkDialogTheme;
                break;
            case GREEN:
                style = R.style.GreenDialogTheme;
                break;
            default:
                break;
        }
        builder = new AlertDialog.Builder(this, style);
        return builder;
    }

    protected ThemeUtils.Theme getCurrentTheme(){
        int value = preferenceUtils.getIntParam(getString(R.string.change_theme_key), 0);
        return ThemeUtils.Theme.mapValueToTheme(value);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        activityGraph = null;
    }

    /**
     * 增加了默认的返回finish事件
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        switch (id) {
            case android.R.id.home:
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
        
    }

    protected abstract int getLayoutView();

    protected abstract List<Object> getModules();

    protected abstract void initToolbar();
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/EditNoteTypeActivity.java
================================================
package com.lguipeng.notes.ui;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.Menu;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;

import com.lguipeng.notes.R;
import com.lguipeng.notes.model.NoteType;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.utils.JsonUtils;
import com.lguipeng.notes.utils.NoteConfig;
import com.lguipeng.notes.utils.PreferenceUtils;
import com.rengwuxian.materialedittext.MaterialEditText;

import java.util.Arrays;
import java.util.List;

import butterknife.InjectView;
import de.greenrobot.event.EventBus;

/**
 * Created by lgp on 2015/6/2.
 */
public class EditNoteTypeActivity extends BaseActivity{
    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    @InjectView(R.id.edit_root_view)
    LinearLayout editRootView;

    private MaterialEditText[] editTexts = new MaterialEditText[NoteType.ALL_COUNT - 1];

    private MenuItem doneMenuItem;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initEditTextView();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_note, menu);
        return true;
    }

    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        doneMenuItem = menu.getItem(0);
        doneMenuItem.setVisible(false);
        return super.onPrepareOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case R.id.done:
                hideKeyBoard(editTexts[0]);
                NoteType type = new NoteType();
                for (MaterialEditText view : editTexts){
                    type.addType(view.getText().toString());
                }

                type.addType(getString(R.string.recycle_bin));
                String json = JsonUtils.jsonNoteType(type);
                preferenceUtils.saveParam(PreferenceUtils.NOTE_TYPE_KEY, json);
                EventBus.getDefault().post(NoteConfig.NOTE_TYPE_UPDATE_EVENT);
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_edit_note_type;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
        toolbar.setTitle(R.string.edit);
    }

    private void initEditTextView(){
        String json = preferenceUtils.getStringParam(PreferenceUtils.NOTE_TYPE_KEY);
        List<String> lists = JsonUtils.parseNoteType(json);
        if (lists == null)
            return;
        for (int i=0; i< editTexts.length; i++){
            MaterialEditText view = (MaterialEditText)getLayoutInflater().inflate(R.layout.edit_layout, null);
            view.addTextChangedListener(new SimpleTextWatcher());
            if (i < lists.size()){
                view.setText(lists.get(i));
                view.setSelection(lists.get(i).length());
            }
            editRootView.addView(view);
            editTexts[i] = view;
        }
    }

    class SimpleTextWatcher implements TextWatcher {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (doneMenuItem == null)
                return;
            boolean allFill = true;
            for (MaterialEditText view : editTexts){
                if (TextUtils.isEmpty(view.getText().toString()))
                    allFill = false;
            }
            if (allFill){
                doneMenuItem.setVisible(true);
            }else {
                doneMenuItem.setVisible(false);
            }
        }

        @Override
        public void afterTextChanged(Editable s) {

        }
    }

    private void hideKeyBoard(EditText editText){
        InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(editText.getWindowToken(), 0);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/MainActivity.java
================================================
package com.lguipeng.notes.ui;

import android.app.SearchManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;

import com.lguipeng.notes.R;
import com.lguipeng.notes.adpater.BaseRecyclerViewAdapter;
import com.lguipeng.notes.adpater.DrawerListAdapter;
import com.lguipeng.notes.adpater.NotesAdapter;
import com.lguipeng.notes.adpater.SimpleListAdapter;
import com.lguipeng.notes.listener.bmob.FindListenerImpl;
import com.lguipeng.notes.listener.bmob.SaveListenerImpl;
import com.lguipeng.notes.listener.bmob.UpdateListenerImpl;
import com.lguipeng.notes.model.CloudNote;
import com.lguipeng.notes.model.Note;
import com.lguipeng.notes.model.NoteOperateLog;
import com.lguipeng.notes.model.NoteType;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.utils.AccountUtils;
import com.lguipeng.notes.utils.JsonUtils;
import com.lguipeng.notes.utils.NoteConfig;
import com.lguipeng.notes.utils.PreferenceUtils;
import com.lguipeng.notes.utils.SnackbarUtils;
import com.melnykov.fab.FloatingActionButton;
import com.melnykov.fab.ScrollDirectionListener;
import com.pnikosis.materialishprogress.ProgressWheel;

import net.tsz.afinal.FinalDb;

import java.util.Arrays;
import java.util.List;

import javax.inject.Inject;

import butterknife.InjectView;
import butterknife.OnClick;
import cn.bmob.v3.BmobQuery;
import de.greenrobot.event.EventBus;

/**
 * Created by lgp on 2015/5/24.
 */
public class MainActivity extends BaseActivity implements SwipeRefreshLayout.OnRefreshListener{

    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    @InjectView(R.id.refresher)
    SwipeRefreshLayout refreshLayout;

    @InjectView(R.id.recyclerView)
    RecyclerView recyclerView;

    @InjectView(R.id.drawer_layout)
    DrawerLayout mDrawerLayout;

    @InjectView(R.id.edit_note_type)
    Button editNoteTypeButton;

    @InjectView(R.id.left_drawer_listview)
    ListView mDrawerMenuListView;

    @InjectView(R.id.left_drawer)
    View drawerRootView;

    @InjectView(R.id.fab)
    FloatingActionButton fab;

    @InjectView(R.id.progress_wheel)
    ProgressWheel progressWheel;

    @Inject
    FinalDb finalDb;

    private ActionBarDrawerToggle mDrawerToggle;

    private SearchView searchView;

    private NotesAdapter recyclerAdapter;

    private int mCurrentNoteType;

    private boolean rightHandOn = false;

    private boolean cardLayout = true;

    private boolean hasUpdateNote = false;

    private boolean hasEditClick = false;

    private  List<String> noteTypelist;

    private boolean hasSyncing = false;

    private final String  CURRENT_NOTE_TYPE_KEY = "CURRENT_NOTE_TYPE_KEY";

    private final String  PROGRESS_WHEEL_KEY = "PROGRESS_WHEEL_KEY";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null){
            mCurrentNoteType = savedInstanceState.getInt(CURRENT_NOTE_TYPE_KEY);
            progressWheel.onRestoreInstanceState(savedInstanceState.getParcelable(PROGRESS_WHEEL_KEY));
        }
        initToolbar();
        initDrawerView();
        initRecyclerView();
        EventBus.getDefault().register(this);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt(CURRENT_NOTE_TYPE_KEY, mCurrentNoteType);
        Parcelable parcelable = progressWheel.onSaveInstanceState();
        outState.putParcelable(PROGRESS_WHEEL_KEY, parcelable);
    }

    @Override
    public void onStart() {
        super.onStart();
        if (rightHandOn != preferenceUtils.getBooleanParam(getString(R.string.right_hand_mode_key))){
            rightHandOn = !rightHandOn;
            if (rightHandOn){
                setMenuListViewGravity(Gravity.END);
            }else{
                setMenuListViewGravity(Gravity.START);
            }
        }

    }

    @Override
    protected void onResume() {
        super.onResume();
        if (hasUpdateNote){
            changeToSelectNoteType(mCurrentNoteType);
            hasUpdateNote = false;
        }
        if (cardLayout != preferenceUtils.getBooleanParam(getString(R.string.card_note_item_layout_key), true)){
            changeItemLayout(!cardLayout);
        }
    }

    @Override
    public void onStop() {
        super.onStop();
    }

    @Override
    public void onDestroy() {
        EventBus.getDefault().unregister(this);
        super.onDestroy();
    }

    public void onEvent(Integer event){
        switch (event){
            case NoteConfig.NOTE_UPDATE_EVENT:
                hasUpdateNote = true;
                break;
            case NoteConfig.NOTE_TYPE_UPDATE_EVENT:
                initDrawerListView();
                break;
            case NoteConfig.CHANGE_THEME_EVENT:
                this.recreate();
                break;
        }
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_main;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        mDrawerToggle.onConfigurationChanged(newConfig);
    }

    @Override
    public void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        mDrawerToggle.syncState();
        if (toolbar != null){
            toolbar.setNavigationOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    openOrCloseDrawer();
                }
            });
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        SearchManager searchManager =
                (SearchManager) getSystemService(Context.SEARCH_SERVICE);
        MenuItem searchItem = menu.findItem(R.id.action_search);
        //searchItem.expandActionView();
        searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
        ComponentName componentName = getComponentName();

        searchView.setSearchableInfo(
                searchManager.getSearchableInfo(componentName));
        searchView.setQueryHint(getString(R.string.search_note));
        searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String s) {
                return true;
            }

            @Override
            public boolean onQueryTextChange(String s) {
                recyclerAdapter.getFilter().filter(s);
                return true;
            }
        });
        MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
            @Override
            public boolean onMenuItemActionExpand(MenuItem item) {
                recyclerAdapter.setUpFactor();
                refreshLayout.setEnabled(false);
                return true;
            }

            @Override
            public boolean onMenuItemActionCollapse(MenuItem item) {
                refreshLayout.setEnabled(true);
                return true;
            }
        });
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if(mDrawerToggle.onOptionsItemSelected(item)) {
            return true;
        }
        Intent intent;
        switch (item.getItemId()){
            case R.id.setting:
                intent = new Intent(MainActivity.this, SettingActivity.class);
                startActivity(intent);
                return true;
            case R.id.sync:
                sync();
                return true;
            case R.id.about:
                intent = new Intent(MainActivity.this, AboutActivity.class);
                startActivity(intent);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && mDrawerLayout.isDrawerOpen(drawerRootView)){
            mDrawerLayout.closeDrawer(drawerRootView);
            return true;
        }
        moveTaskToBack(true);
        return super.onKeyDown(keyCode, event);
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
    }

    private void initDrawerListView(){
        String json = preferenceUtils.getStringParam(PreferenceUtils.NOTE_TYPE_KEY);
        if (!TextUtils.isEmpty(json)){
            noteTypelist = JsonUtils.parseNoteType(json);
        }else{
            noteTypelist = Arrays.asList(getResources().getStringArray(R.array.drawer_content));
            NoteType type = new NoteType();
            type.setTypes(noteTypelist);
            String text = JsonUtils.jsonNoteType(type);
            preferenceUtils.saveParam(PreferenceUtils.NOTE_TYPE_KEY, text);
        }

        SimpleListAdapter adapter = new DrawerListAdapter(this, noteTypelist);
        mDrawerMenuListView.setAdapter(adapter);
        mDrawerMenuListView.setItemChecked(mCurrentNoteType, true);
        toolbar.setTitle(noteTypelist.get(mCurrentNoteType));
    }

    private void initDrawerView() {
        initDrawerListView();
        mDrawerMenuListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                mDrawerMenuListView.setItemChecked(position, true);
                openOrCloseDrawer();
                mCurrentNoteType = position;
                changeToSelectNoteType(mCurrentNoteType);
                if (mCurrentNoteType == NoteConfig.NOTE_TRASH_TYPE) {
                    fab.hide();
                    fab.setVisibility(View.INVISIBLE);
                } else {
                    fab.setVisibility(View.VISIBLE);
                    fab.show();
                }
            }
        });

        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, 0, 0){
            @Override
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
                invalidateOptionsMenu();
                toolbar.setTitle(R.string.app_name);
            }

            @Override
            public void onDrawerClosed(View drawerView) {
                super.onDrawerClosed(drawerView);
                invalidateOptionsMenu();
                toolbar.setTitle(noteTypelist.get(mCurrentNoteType));
                if (hasEditClick){
                    Intent intent = new Intent(MainActivity.this, EditNoteTypeActivity.class);
                    startActivity(intent);
                    hasEditClick = false;
                }
            }
        };
        mDrawerToggle.setDrawerIndicatorEnabled(true);
        mDrawerLayout.setDrawerListener(mDrawerToggle);
        mDrawerLayout.setScrimColor(getColor(R.color.drawer_scrim_color));
        rightHandOn = preferenceUtils.getBooleanParam(getString(R.string.right_hand_mode_key));
        if (rightHandOn){
            setMenuListViewGravity(Gravity.END);
        }
    }



    private void initRecyclerView(){
        showProgressWheel(true);
        initItemLayout();
        recyclerView.setHasFixedSize(true);
        recyclerAdapter = new NotesAdapter(initItemData(mCurrentNoteType), this);
        recyclerAdapter.setOnInViewClickListener(R.id.notes_item_root,
                new BaseRecyclerViewAdapter.onInternalClickListenerImpl<Note>() {
                    @Override
                    public void OnClickListener(View parentV, View v, Integer position, Note values) {
                        super.OnClickListener(parentV, v, position, values);
                        if (mCurrentNoteType == NoteConfig.NOTE_TRASH_TYPE)
                            return;
                        startNoteActivity(NoteActivity.VIEW_NOTE_TYPE, values);
                    }
                });
        recyclerAdapter.setOnInViewClickListener(R.id.note_more,
                new BaseRecyclerViewAdapter.onInternalClickListenerImpl<Note>() {
                    @Override
                    public void OnClickListener(View parentV, View v, Integer position, Note values) {
                        super.OnClickListener(parentV, v, position, values);
                        showPopupMenu(v, values);
                    }
                });
        recyclerAdapter.setFirstOnly(false);
        recyclerAdapter.setDuration(300);
        recyclerView.setAdapter(recyclerAdapter);
        fab.attachToRecyclerView(recyclerView, new ScrollDirectionListener() {
            @Override
            public void onScrollDown() {
                recyclerAdapter.setDownFactor();
            }

            @Override
            public void onScrollUp() {
                recyclerAdapter.setUpFactor();
            }
        });
        showProgressWheel(false);
        refreshLayout.setColorSchemeColors(getColorPrimary());
        refreshLayout.setOnRefreshListener(this);
    }

    @OnClick(R.id.fab)
    public void newNote(View view){
        Note note = new Note();
        note.setType(mCurrentNoteType);
        startNoteActivity(NoteActivity.CREATE_NOTE_TYPE, note);
    }

    @OnClick(R.id.edit_note_type)
    public void editNoteType(View view){
        hasEditClick = true;
        openOrCloseDrawer();
    }


    @Override
    public void onRefresh() {
        sync();
    }

    private void changeToSelectNoteType(int type){
        showProgressWheel(true);
        recyclerAdapter.setList(initItemData(type));
        showProgressWheel(false);
    }

    private void openDrawer() {
        if (!mDrawerLayout.isDrawerOpen(drawerRootView)) {
            mDrawerLayout.openDrawer(drawerRootView);
        }
    }

    private void closeDrawer() {
        if (mDrawerLayout.isDrawerOpen(drawerRootView)) {
            mDrawerLayout.closeDrawer(drawerRootView);
        }
    }

    private void openOrCloseDrawer() {
        if (mDrawerLayout.isDrawerOpen(drawerRootView)) {
            mDrawerLayout.closeDrawer(drawerRootView);
        } else {
            mDrawerLayout.openDrawer(drawerRootView);
        }
    }

    private void showPopupMenu(View view, final Note note) {
        PopupMenu popup = new PopupMenu(this, view);
        //Inflating the Popup using xml file
        String move = getString(R.string.move_to);
        if (mCurrentNoteType == NoteConfig.NOTE_TRASH_TYPE){
            for (int i=0; i< noteTypelist.size()-1; i++){
                popup.getMenu().add(Menu.NONE, i, Menu.NONE, move + noteTypelist.get(i));
            }
            popup.getMenu().add(Menu.NONE, noteTypelist.size()-1, Menu.NONE, getString(R.string.delete_forever));
            popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                @Override
                public boolean onMenuItemClick(MenuItem item) {
                    int id = item.getItemId();
                    if (id < noteTypelist.size() - 1) {
                        note.setType(id);
                        finalDb.update(note);
                        changeToSelectNoteType(mCurrentNoteType);
                    } else {
                        showDeleteForeverDialog(note);
                    }
                    return true;
                }
            });

        } else {
            popup.getMenuInflater()
                    .inflate(R.menu.menu_notes_more, popup.getMenu());
            popup.setOnMenuItemClickListener(
                    new PopupMenu.OnMenuItemClickListener() {
                        @Override
                        public boolean onMenuItemClick(MenuItem item) {
                            switch (item.getItemId()) {
                                case R.id.delete_forever:
                                    showDeleteForeverDialog(note);
                                    break;
                                case R.id.edit:
                                    startNoteActivity(NoteActivity.EDIT_NOTE_TYPE, note);
                                    break;
                                case R.id.move_to_trash:
                                    note.setType(NoteConfig.NOTE_TRASH_TYPE);
                                    finalDb.update(note);
                                    changeToSelectNoteType(mCurrentNoteType);
                                    break;
                                default:
                                    break;
                            }
                            return true;
                        }
                    });
        }
        popup.show(); //showing popup menu
    }

    private void showDeleteForeverDialog(final Note note){
        AlertDialog.Builder builder = generateDialogBuilder();
        builder.setTitle(R.string.delete_forever_message);
        DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                switch (which){
                    case DialogInterface.BUTTON_POSITIVE:
                        for (NoteOperateLog log : note.getLogs().getList()){
                            finalDb.delete(log);
                        }
                        finalDb.delete(note);
                        changeToSelectNoteType(mCurrentNoteType);
                        break;
                    case DialogInterface.BUTTON_NEGATIVE:
                        break;
                    default:
                        break;
                }
            }
        };
        builder.setPositiveButton(R.string.sure, listener);
        builder.setNegativeButton(R.string.cancel, listener);
        builder.show();
    }

    private void startNoteActivity(int oprType, Note value){
        Intent intent = new Intent(this, NoteActivity.class);
        Bundle bundle = new Bundle();
        bundle.putInt(NoteActivity.OPERATE_NOTE_TYPE_KEY, oprType);
        EventBus.getDefault().postSticky(value);
        intent.putExtras(bundle);
        startActivity(intent);
    }

    private void setMenuListViewGravity(int gravity){
        DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) drawerRootView.getLayoutParams();
        params.gravity = gravity;
        drawerRootView.setLayoutParams(params);
    }

    private List<Note> initItemData(int noteType) {
        List<Note> itemList = null;
        switch (noteType){
            case NoteConfig.NOTE_STUDY_TYPE:
            case NoteConfig.NOTE_WORK_TYPE:
            case NoteConfig.NOTE_OTHER_TYPE:
            case NoteConfig.NOTE_TRASH_TYPE:
                itemList = finalDb.findAllByWhere(Note.class, "type = " + noteType, "lastOprTime", true);
                break;
            default:
                break;
        }
        return itemList;
    }

    private void showProgressWheel(boolean visible){
        progressWheel.setBarColor(getColorPrimary());
        if (visible){
            if (!progressWheel.isSpinning())
                progressWheel.spin();
        }else{
            progressWheel.postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (progressWheel.isSpinning()) {
                        progressWheel.stopSpinning();
                    }
                }
            }, 500);
        }
    }

    private void syncNotes(final String account){
        new Thread(){
            @Override
            public void run() {
                BmobQuery<CloudNote> query = new BmobQuery<>();
                query.addWhereEqualTo("email", account);
                query.findObjects(MainActivity.this, new FindListenerImpl<CloudNote>(){
                    CloudNote cloudNote;
                    @Override
                    public void onSuccess(List<CloudNote> notes) {
                        List<Note> list = finalDb.findAll(Note.class);
                        if (notes != null && notes.size() >= 1){
                            cloudNote = notes.get(0);
                            long localVersion = preferenceUtils.getLongParam(account);
                            if (cloudNote.getVersion() > localVersion){
                                //pull notes
                                preferenceUtils.saveParam(PreferenceUtils.NOTE_TYPE_KEY, cloudNote.getNoteType());
                                for (String string : cloudNote.getNoteList()) {
                                    Note note = JsonUtils.parseNote(string);
                                    if (note == null)
                                        continue;
                                    finalDb.saveBindId(note);
                                    NoteOperateLog log = new NoteOperateLog();
                                    log.setTime(note.getLastOprTime());
                                    log.setType(NoteConfig.NOTE_CREATE_OPR);
                                    log.setNote(note);
                                    finalDb.save(log);
                                }
                                preferenceUtils.saveParam(account, cloudNote.getVersion());
                                runOnUiThread(new Runnable() {
                                    @Override
                                    public void run() {
                                        initDrawerListView();
                                        changeToSelectNoteType(mCurrentNoteType);
                                        onSyncSuccess();
                                    }
                                });
                                return;
                            }else {
                                //upload notes
                                cloudNote.setVersion(++localVersion);
                            }
                        }else {
                            cloudNote = new CloudNote();
                            cloudNote.setEmail(account);
                            cloudNote.setVersion(1);

                        }
                        cloudNote.clearNotes();
                        for (Note note : list){
                            cloudNote.addNote(note);
                        }
                        String json = preferenceUtils.getStringParam(PreferenceUtils.NOTE_TYPE_KEY);
                        cloudNote.setNoteType(json);
                        if (TextUtils.isEmpty(cloudNote.getObjectId())){
                            cloudNote.save(MainActivity.this, new SaveListenerImpl() {
                                @Override
                                public void onSuccess() {
                                    preferenceUtils.saveParam(account, cloudNote.getVersion());
                                    onSyncSuccess();
                                }

                                @Override
                                public void onFailure(int i, String s) {
                                    super.onFailure(i, s);
                                    onSyncFail();
                                }
                            });
                        }else{
                            cloudNote.update(MainActivity.this, new UpdateListenerImpl() {
                                @Override
                                public void onSuccess() {
                                    preferenceUtils.saveParam(account, cloudNote.getVersion());
                                    onSyncSuccess();
                                }

                                @Override
                                public void onFailure(int i, String s) {
                                    super.onFailure(i, s);
                                    onSyncFail();
                                }
                            });
                        }
                    }

                    @Override
                    public void onError(int i, String s) {
                        super.onError(i, s);
                        onSyncFail();
                    }
                });
            }
        }.start();
    }

    private void sync(){
        if (hasSyncing)
            return;
        String account = preferenceUtils.getStringParam(getString(R.string.sync_account_key));
        if (TextUtils.isEmpty(account)){
            AccountUtils.findValidAccount(getApplicationContext(), new AccountUtils.AccountFinderListener() {
                @Override
                protected void onNone() {
                    if (refreshLayout.isRefreshing()){
                        refreshLayout.setRefreshing(false);
                    }
                    SnackbarUtils.show(MainActivity.this, R.string.no_account_tip);
                }

                @Override
                protected void onOne(String account) {
                    preferenceUtils.saveParam(getString(R.string.sync_account_key), account);
                    hasSyncing = true;
                    syncNotes(account);
                }

                @Override
                protected void onMore(List<String> accountItems) {
                    if (refreshLayout.isRefreshing()){
                        refreshLayout.setRefreshing(false);
                    }
                    SnackbarUtils.show(MainActivity.this, R.string.no_account_tip);
                }
            });

        }else {
            if (!refreshLayout.isRefreshing()){
                refreshLayout.setRefreshing(true);
            }
            hasSyncing = true;
            syncNotes(account);
        }
    }

    private void onSyncSuccess(){
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                hasSyncing = false;
                refreshLayout.setRefreshing(false);
                SnackbarUtils.show(MainActivity.this, R.string.sync_success);
            }
        });
    }

    private void onSyncFail(){
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                hasSyncing = false;
                refreshLayout.setRefreshing(false);
                SnackbarUtils.show(MainActivity.this, R.string.sync_fail);
            }
        });
    }

    private void changeItemLayout(boolean flow){
        cardLayout = flow;
        if (!flow){
            recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        }else {
            recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, LinearLayoutManager.VERTICAL));
        }
    }

    private void initItemLayout(){
        if (preferenceUtils.getBooleanParam(getString(R.string.card_note_item_layout_key), true)){
            cardLayout = true;
            recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, LinearLayoutManager.VERTICAL));
        }else {
            cardLayout = false;
            recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        }
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/NoteActivity.java
================================================
package com.lguipeng.notes.ui;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

import com.lguipeng.notes.R;
import com.lguipeng.notes.model.Note;
import com.lguipeng.notes.model.NoteOperateLog;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.utils.NoteConfig;
import com.lguipeng.notes.utils.TimeUtils;
import com.rengwuxian.materialedittext.MaterialEditText;

import net.tsz.afinal.FinalDb;

import java.util.Arrays;
import java.util.List;

import javax.inject.Inject;

import butterknife.InjectView;
import de.greenrobot.event.EventBus;

/**
 * Created by lgp on 2015/5/25.
 */
public class NoteActivity extends BaseActivity{
    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    @InjectView(R.id.label_edit_text)
    MaterialEditText labelEditText;

    @InjectView(R.id.content_edit_text)
    MaterialEditText contentEditText;

    @InjectView(R.id.opr_time_line_text)
    TextView oprTimeLineTextView;

    @Inject
    FinalDb finalDb;

    private MenuItem doneMenuItem;

    private int operateNoteType = 0;

    private Note note;

    public final static String OPERATE_NOTE_TYPE_KEY = "OPERATE_NOTE_TYPE_KEY";

    public final static int VIEW_NOTE_TYPE = 0x00;
    public final static int EDIT_NOTE_TYPE = 0x01;
    public final static int CREATE_NOTE_TYPE = 0x02;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        parseIntent(getIntent());
        EventBus.getDefault().registerSticky(this);
    }

    @Override
    public void onDestroy() {
        EventBus.getDefault().unregister(this);
        super.onDestroy();
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_note;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    public void onEventMainThread(Note note) {
        this.note = note;
        initToolbar();
        initEditText();
        initTextView();
    }

    private void parseIntent(Intent intent){
        if (intent != null && intent.getExtras() != null){
            operateNoteType = intent.getExtras().getInt(OPERATE_NOTE_TYPE_KEY, 0);
        }
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
        toolbar.setTitle(R.string.view_note);
        switch (operateNoteType){
            case CREATE_NOTE_TYPE:
                toolbar.setTitle(R.string.new_note);
                break;
            case EDIT_NOTE_TYPE:
                toolbar.setTitle(R.string.edit_note);
                break;
            case VIEW_NOTE_TYPE:
                toolbar.setTitle(R.string.view_note);
                break;
            default:
                break;
        }
    }

    private void initEditText(){
        switch (operateNoteType){
            case EDIT_NOTE_TYPE:
                labelEditText.requestFocus();
                labelEditText.setText(note.getLabel());
                contentEditText.setText(note.getContent());
                labelEditText.setSelection(note.getLabel().length());
                contentEditText.setSelection(note.getContent().length());
                break;
            case VIEW_NOTE_TYPE:
                labelEditText.setText(note.getLabel());
                contentEditText.setText(note.getContent());
                labelEditText.setOnFocusChangeListener(new SimpleOnFocusChangeListener());
                contentEditText.setOnFocusChangeListener(new SimpleOnFocusChangeListener());
                break;
            default:
                labelEditText.requestFocus();
                break;
        }
        labelEditText.addTextChangedListener(new SimpleTextWatcher());
        contentEditText.addTextChangedListener(new SimpleTextWatcher());
    }

    private void initTextView(){
        boolean all = preferenceUtils.getBooleanParam(getString(R.string.show_note_history_log_key));
        oprTimeLineTextView.setText(getOprTimeLineText(note, all));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_note, menu);
        return true;
    }

    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        doneMenuItem = menu.getItem(0);
        doneMenuItem.setVisible(false);
        return super.onPrepareOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case R.id.done:
                saveNote();
                return true;
            case android.R.id.home:
                if (doneMenuItem.isVisible()){
                    showNotSaveNoteDialog();
                    return true;
                }
                finish();
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK){
            if (doneMenuItem != null && doneMenuItem.isVisible()){
                showNotSaveNoteDialog();
                return true;
            }
        }
        return super.onKeyDown(keyCode, event);
    }

    private void showNotSaveNoteDialog(){
        hideKeyBoard(labelEditText);
        AlertDialog.Builder builder = generateDialogBuilder();
        builder.setTitle(R.string.not_save_note_leave_tip);
        DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                switch (which){
                    case DialogInterface.BUTTON_POSITIVE:
                        saveNote();
                        break;
                    case DialogInterface.BUTTON_NEGATIVE:
                        NoteActivity.this.finish();
                        break;
                    default:
                        break;
                }
            }
        };
        builder.setPositiveButton(R.string.sure, listener);
        builder.setNegativeButton(R.string.cancel, listener);
        builder.show();
    }

    private void saveNote(){
        hideKeyBoard(labelEditText);
        note.setLabel(labelEditText.getText().toString());
        note.setContent(contentEditText.getText().toString());
        note.setLastOprTime(TimeUtils.getCurrentTimeInLong());

        NoteOperateLog log = new NoteOperateLog();
        log.setTime(TimeUtils.getCurrentTimeInLong());
        switch (operateNoteType){
            case CREATE_NOTE_TYPE:
                finalDb.saveBindId(note);
                log.setType(NoteConfig.NOTE_CREATE_OPR);
                log.setNote(note);
                finalDb.save(log);
                break;
            default:
                finalDb.update(note);
                log.setType(NoteConfig.NOTE_EDIT_OPR);
                log.setNote(note);
                finalDb.save(log);
                break;
        }
        EventBus.getDefault().post(NoteConfig.NOTE_UPDATE_EVENT);
        finish();
    }

    class SimpleTextWatcher implements TextWatcher {

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (doneMenuItem == null)
                return;
            String labelSrc = labelEditText.getText().toString();
            String contentSrc = contentEditText.getText().toString();
            String label = labelSrc.replaceAll("\\s*|\t|\r|\n", "");
            String content = contentSrc.replaceAll("\\s*|\t|\r|\n", "");
            if (!TextUtils.isEmpty(label) && !TextUtils.isEmpty(content)){
                if (TextUtils.equals(labelSrc, note.getLabel()) && TextUtils.equals(contentSrc, note.getContent())){
                    doneMenuItem.setVisible(false);
                    return;
                }
                doneMenuItem.setVisible(true);
            }else{
                doneMenuItem.setVisible(false);
            }
        }

        @Override
        public void afterTextChanged(Editable s) {

        }
    }

    class SimpleOnFocusChangeListener implements View.OnFocusChangeListener {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (hasFocus && toolbar != null){
                toolbar.setTitle(R.string.edit_note);
            }
        }
    }

    private String getOprTimeLineText(Note note, boolean all){
        if (note == null || note.getLogs() == null)
            return "";
        String create = getString(R.string.create);
        String edit = getString(R.string.edit);
        StringBuilder sb = new StringBuilder();
        if (note.getLogs().getList().size() <= 0){
            return "";
        }
        NoteOperateLog log;
        List<NoteOperateLog> logs = note.getLogs().getList();
        int size = logs.size();
        if (!all){
            log = logs.get(size - 1);
            if (log.getType() == NoteConfig.NOTE_CREATE_OPR){
                sb.append(getString(R.string.note_log_text, create, TimeUtils.getTime(log.getTime())));
            }else{
                sb.append(getString(R.string.note_log_text, edit, TimeUtils.getTime(log.getTime())));
            }
            return sb.toString();
        }
        for (int i=size-1; i>=0; i--){
            log = logs.get(i);
            if (log.getType() == NoteConfig.NOTE_CREATE_OPR){
                sb.append(getString(R.string.note_log_text, create, TimeUtils.getTime(log.getTime())));
            }else{
                sb.append(getString(R.string.note_log_text, edit, TimeUtils.getTime(log.getTime())));
            }
            sb.append("\n");
        }
        return sb.toString();
    }

    private void hideKeyBoard(EditText editText){
        InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(editText.getWindowToken(), 0);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/PayActivity.java
================================================
package com.lguipeng.notes.ui;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import com.lguipeng.notes.R;
import com.lguipeng.notes.module.DataModule;

import java.util.Arrays;
import java.util.List;

import butterknife.InjectView;

/**
 * Created by lgp on 2015/6/1.
 */
public class PayActivity extends BaseActivity{
    @InjectView(R.id.toolbar)
    Toolbar toolbar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_pay;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
        toolbar.setTitle(R.string.pay_for_me);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/SettingActivity.java
================================================
package com.lguipeng.notes.ui;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import com.lguipeng.notes.R;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.ui.fragments.SettingFragment;

import java.util.Arrays;
import java.util.List;

import butterknife.InjectView;

/**
 * Created by lgp on 2015/5/24.
 */
public class SettingActivity extends BaseActivity{
    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
    }

    @Override
    protected int getLayoutView() {
        return R.layout.activity_setting;
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    @Override
    protected void initToolbar(){
        super.initToolbar(toolbar);
        toolbar.setTitle(R.string.setting);
    }

    private void init(){
        SettingFragment settingFragment = SettingFragment.newInstance();
        getFragmentManager().beginTransaction().replace(R.id.fragment_content, settingFragment).commit();
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/fragments/BaseFragment.java
================================================
package com.lguipeng.notes.ui.fragments;

import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.support.v7.app.AlertDialog;

import com.lguipeng.notes.App;
import com.lguipeng.notes.R;
import com.lguipeng.notes.ui.BaseActivity;
import com.lguipeng.notes.utils.PreferenceUtils;
import com.lguipeng.notes.utils.ThemeUtils;

import java.util.List;

import dagger.ObjectGraph;

/**
 * Created by lgp on 2015/5/26.
 */
public abstract class BaseFragment extends PreferenceFragment {

    private ObjectGraph activityGraph;
    protected BaseActivity activity;
    protected PreferenceUtils preferenceUtils;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityGraph = ((App) getActivity().getApplication()).createScopedGraph(getModules().toArray());
        activityGraph.inject(this);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        if (getActivity() != null && getActivity() instanceof BaseActivity){
            activity = (BaseActivity)getActivity();
        }
        preferenceUtils = PreferenceUtils.getInstance(getActivity());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        activityGraph = null;
    }

    protected AlertDialog.Builder generateDialogBuilder(){
        ThemeUtils.Theme theme = getCurrentTheme();
        AlertDialog.Builder builder;
        switch (theme){
            case BROWN:
                builder = new AlertDialog.Builder(getActivity(), R.style.BrownDialogTheme);
                break;
            case BLUE:
                builder = new AlertDialog.Builder(getActivity(), R.style.BlueDialogTheme);
                break;
            case BLUE_GREY:
                builder = new AlertDialog.Builder(getActivity(), R.style.BlueGreyDialogTheme);
                break;
            default:
                builder = new AlertDialog.Builder(getActivity(), R.style.RedDialogTheme);
                break;
        }
        return builder;
    }

    protected ThemeUtils.Theme getCurrentTheme(){
        int value = preferenceUtils.getIntParam(getString(R.string.change_theme_key), 0);
        return ThemeUtils.Theme.mapValueToTheme(value);
    }

    protected abstract List<Object> getModules();
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/ui/fragments/SettingFragment.java
================================================
package com.lguipeng.notes.ui.fragments;

import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceScreen;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import com.jenzz.materialpreference.CheckBoxPreference;
import com.jenzz.materialpreference.Preference;
import com.jenzz.materialpreference.SwitchPreference;
import com.lguipeng.notes.R;
import com.lguipeng.notes.adpater.ColorsListAdapter;
import com.lguipeng.notes.module.DataModule;
import com.lguipeng.notes.ui.PayActivity;
import com.lguipeng.notes.utils.AccountUtils;
import com.lguipeng.notes.utils.NoteConfig;
import com.lguipeng.notes.utils.PreferenceUtils;
import com.lguipeng.notes.utils.ThemeUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import de.greenrobot.event.EventBus;

/**
 * Created by lgp on 2015/5/26.
 */
public class SettingFragment extends BaseFragment{

    public static final String PREFERENCE_FILE_NAME = "note.settings";

    private CheckBoxPreference showNoteHistoryLogCheckBox;

    private SwitchPreference rightHandModeSwitch;

    private Preference feedbackPreference;

    private Preference payMePreference;

    private Preference giveFavorPreference;

    private Preference accountPreference;

    private boolean showNoteHistoryLog;

    private boolean rightHandMode;

    private boolean cardLayout;

    private  List<String> accountItems = new ArrayList<>();

    private PreferenceUtils preferenceUtils;

    public static SettingFragment newInstance(){
        SettingFragment fragment = new SettingFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        preferenceUtils = PreferenceUtils.getInstance(getActivity());
        addPreferencesFromResource(R.xml.prefs);
        getPreferenceManager().setSharedPreferencesName(PREFERENCE_FILE_NAME);
        showNoteHistoryLog = preferenceUtils.getBooleanParam(getString(R.string.show_note_history_log_key));
        rightHandMode = preferenceUtils.getBooleanParam(getString(R.string.right_hand_mode_key));
        showNoteHistoryLogCheckBox = (CheckBoxPreference)findPreference(getString(R.string.show_note_history_log_key));
        showNoteHistoryLogCheckBox.setChecked(showNoteHistoryLog);
        rightHandModeSwitch = (SwitchPreference)findPreference(getString(R.string.right_hand_mode_key));
        rightHandModeSwitch.setChecked(rightHandMode);
        cardLayout = preferenceUtils.getBooleanParam(getString(R.string.card_note_item_layout_key), true);
        CheckBoxPreference cardLayoutPreference = (CheckBoxPreference)findPreference(getString(R.string.card_note_item_layout_key));
        cardLayoutPreference.setChecked(cardLayout);
        feedbackPreference = (Preference)findPreference(getString(R.string.advice_feedback_key));
        accountPreference = (Preference)findPreference(getString(R.string.sync_account_key));
        payMePreference = (Preference)findPreference(getString(R.string.pay_for_me_key));
        giveFavorPreference = (Preference)findPreference(getString(R.string.give_favor_key));
        initFeedbackPreference();
        initAccountPreference();
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        View listView = view.findViewById(android.R.id.list);
        listView.setHorizontalScrollBarEnabled(false);
        listView.setVerticalScrollBarEnabled(false);
    }

    public SettingFragment() {
        super();
    }

    @Override
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,  android.preference.Preference preference) {
        if (preference == null)
            return super.onPreferenceTreeClick(preferenceScreen, preference);
        String key = preference.getKey();
        if (TextUtils.equals(key, getString(R.string.right_hand_mode_key))){
            rightHandMode = !rightHandMode;
            preferenceUtils.saveParam(getString(R.string.right_hand_mode_key), rightHandMode);
        }

        if (TextUtils.equals(key, getString(R.string.card_note_item_layout_key))){
            cardLayout = !cardLayout;
            preferenceUtils.saveParam(getString(R.string.card_note_item_layout_key), cardLayout);
        }

        if (TextUtils.equals(key, getString(R.string.show_note_history_log_key))){
            showNoteHistoryLog = !showNoteHistoryLog;
            preferenceUtils.saveParam(getString(R.string.show_note_history_log_key), showNoteHistoryLog);
        }

        if (TextUtils.equals(key, getString(R.string.change_theme_key))){
           showThemeChooseDialog();
        }

        if (TextUtils.equals(key, getString(R.string.pay_for_me_key))){
            Intent intent = new Intent(getActivity(), PayActivity.class);
            startActivity(intent);
        }

        if (TextUtils.equals(key, getString(R.string.give_favor_key))){
            giveFavor();
        }
        return super.onPreferenceTreeClick(preferenceScreen, preference);
    }

    @Override
    protected List<Object> getModules() {
        return Arrays.<Object>asList(new DataModule());
    }

    private void initFeedbackPreference(){
        Uri uri = Uri.parse("mailto:lgpszu@163.com");
        final Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
        PackageManager pm = getActivity().getPackageManager();
        List<ResolveInfo> infos = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        if (infos == null || infos.size() <= 0){
            feedbackPreference.setSummary(getString(R.string.no_email_app_tip));
            return;
        }
        feedbackPreference.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(android.preference.Preference preference) {
                startActivity(intent);
                return true;
            }
        });

    }

    private void initAccountPreference(){
        AccountUtils.findValidAccount(getActivity(), new AccountUtils.AccountFinderListener() {
            @Override
            protected void onNone() {
                accountPreference.setSummary(getString(R.string.no_account_tip));
            }

            @Override
            protected void onOne(String account) {
                accountPreference.setSummary(account);
                preferenceUtils.saveParam(getString(R.string.sync_account_key), account);
            }

            @Override
            protected void onMore(List<String> items) {
                SettingFragment.this.accountItems = items;
                String account = preferenceUtils.getStringParam(getString(R.string.sync_account_key));
                if (!isHasAccountSave()) {
                    accountPreference.setSummary(getString(R.string.multi_account_choose_tip));
                } else {
                    accountPreference.setSummary(account);
                }

                accountPreference.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() {
                    @Override
                    public boolean onPreferenceClick(android.preference.Preference preference) {
                        showAccountChooseDialog(accountItems.toArray(new String[accountItems.size()]));
                        return true;
                    }
                });
            }
        });
    }

    private void showThemeChooseDialog(){
        AlertDialog.Builder builder = generateDialogBuilder();
        builder.setTitle(R.string.change_theme);
        Integer[] res = new Integer[]{R.drawable.red_round, R.drawable.brown_round, R.drawable.blue_round,
                R.drawable.blue_grey_round, R.drawable.yellow_round, R.drawable.deep_purple_round,
                R.drawable.pink_round, R.drawable.green_round};
        List<Integer> list = Arrays.asList(res);
        ColorsListAdapter adapter = new ColorsListAdapter(getActivity(), list);
        adapter.setCheckItem(getCurrentTheme().getIntValue());
        GridView gridView = (GridView)LayoutInflater.from(getActivity()).inflate(R.layout.colors_panel_layout, null);
        gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
        gridView.setCacheColorHint(0);
        gridView.setAdapter(adapter);
        builder.setView(gridView);
        final AlertDialog dialog = builder.show();
        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                dialog.dismiss();
                int value = getCurrentTheme().getIntValue();
                if (value != position){
                    preferenceUtils.saveParam(getString(R.string.change_theme_key), position);
                    changeTheme(ThemeUtils.Theme.mapValueToTheme(position));
                }
            }
        });
    }

    private void showAccountChooseDialog(final CharSequence[] text){
        AlertDialog.Builder builder = generateDialogBuilder();
        builder.setTitle(R.string.choose_account);
        builder.setItems(text, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                accountPreference.setSummary(text[which]);
                String account = preferenceUtils.getStringParam(getString(R.string.sync_account_key));
                if (TextUtils.equals(account, text[which]))
                    return;
                preferenceUtils.saveParam(getString(R.string.sync_account_key), text[which].toString());
            }
        });
        builder.show();
    }

    private void giveFavor(){
        try{
            Uri uri = Uri.parse("market://details?id="+ getActivity().getPackageName());
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
        }catch(ActivityNotFoundException e){
            e.printStackTrace();
        }
    }

    private void changeTheme(ThemeUtils.Theme theme){
        if (activity == null)
            return;
        //ThemeUtils.changTheme(activity, theme);
        //activity.recreate();
        EventBus.getDefault().post(NoteConfig.CHANGE_THEME_EVENT);
        activity.finish();
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/AccountUtils.java
================================================
package com.lguipeng.notes.utils;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.text.TextUtils;
import android.util.Patterns;

import com.lguipeng.notes.R;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 * Created by lgp on 2015/5/29.
 */
public class AccountUtils {

    private static final String EMAIL_TYPE = "com.android.email";

    public static void findValidAccount(Context context, AccountFinderListener listener){
        if (listener == null)
            return;
        String accountString = PreferenceUtils.getInstance(context).getStringParam(context.getString(R.string.sync_account_key));
        if (!TextUtils.isEmpty(accountString)){
            listener.setHasAccountSave(true);
        }
        Pattern emailPattern = Patterns.EMAIL_ADDRESS;
        Account[] accounts = AccountManager.get(context.getApplicationContext()).getAccounts();
        List<String> accountItems = new ArrayList<>();
        for (Account account : accounts) {
            if (emailPattern.matcher(account.name).matches() && TextUtils.equals(EMAIL_TYPE, account.type)) {
                accountItems.add(account.name);
            }
        }
        if (accountItems.size() <= 0){
            if (listener.isHasAccountSave()){
                listener.onOne(accountString);
                return;
            }
            listener.onNone();
        }
        if (accountItems.size() == 1){
            if (listener.isHasAccountSave()){
                listener.onOne(accountString);
                return;
            }
            listener.onOne(accountItems.get(0));
        }

        if (accountItems.size() > 1){
           listener.onMore(accountItems);
        }
    }

    public static abstract class AccountFinderListener{
        private boolean hasAccountSave = false;
        protected abstract void onNone();
        protected abstract void onOne(String account);
        protected abstract void onMore(List<String> accountItems);

        public boolean isHasAccountSave() {
            return hasAccountSave;
        }

        public void setHasAccountSave(boolean hasAccountSave) {
            this.hasAccountSave = hasAccountSave;
        }
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/JsonUtils.java
================================================
package com.lguipeng.notes.utils;

import android.text.TextUtils;

import com.alibaba.fastjson.JSON;
import com.lguipeng.notes.model.Note;
import com.lguipeng.notes.model.NoteType;

import java.util.List;

/**
 * Created by lgp on 2015/5/28.
 */
public class JsonUtils {

    public static <T> String json(T note){
        if (note == null)
            return "";
        try {
            return JSON.toJSONString(note);
        }catch (Exception e){
            e.printStackTrace();
            return "";
        }
    }

    public static <T> T parse(String json, Class<T> clazz){
        if (TextUtils.isEmpty(json))
            return null;
        try {
            return JSON.parseObject(json, clazz);
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    public static Note parseNote(String json){
        return parse(json, Note.class);
    }

    public static String jsonNote(Note note){
        return json(note);
    }

    public static List<String> parseNoteType(String json){
        NoteType type = parse(json, NoteType.class);
        if (type == null)
            return null;
        return type.getTypes();
    }

    public static String jsonNoteType(NoteType type){
        return json(type);
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/NoteConfig.java
================================================
package com.lguipeng.notes.utils;

/**
 * Created by lgp on 2015/5/25.
 */
public class NoteConfig {

    public final static int NOTE_CREATE_OPR = 0x00;
    public final static int NOTE_EDIT_OPR = 0x01;

    public final static int NOTE_STUDY_TYPE = 0x00;
    public final static int NOTE_WORK_TYPE = 0x01;
    public final static int NOTE_OTHER_TYPE = 0x02;
    public final static int NOTE_TRASH_TYPE = 0x03;

    public final static int NOTE_UPDATE_EVENT = 0x00;
    public final static int NOTE_TYPE_UPDATE_EVENT = 0x01;
    public final static int CHANGE_THEME_EVENT = 0x02;
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/NotesLog.java
================================================
/***
 This is free and unencumbered software released into the public domain.
 Anyone is free to copy, modify, publish, use, compile, sell, or
 distribute this software, either in source code form or as a compiled
 binary, for any purpose, commercial or non-commercial, and by any
 means.
 For more information, please refer to <http://unlicense.org/>
 */

package com.lguipeng.notes.utils;

import android.util.Log;

import com.lguipeng.notes.BuildConfig;

/**
 * @date 21.06.2012
 * @author Mustafa Ferhan Akman
 *
 * Create a simple and more understandable Android logs. 
 * */

public class NotesLog{

    static String className;
    static String methodName;
    static int lineNumber;

    private NotesLog(){
        /* Protect from instantiations */
    }

    public static boolean isDebuggable() {
        return BuildConfig.DEBUG;
    }

    private static String createLog( String log ) {

        StringBuffer buffer = new StringBuffer();
        buffer.append("[");
        buffer.append(methodName);
        buffer.append(":");
        buffer.append(lineNumber);
        buffer.append("]");
        buffer.append(log);

        return buffer.toString();
    }

    private static void getMethodNames(StackTraceElement[] sElements){
        className = sElements[1].getFileName();
        methodName = sElements[1].getMethodName();
        lineNumber = sElements[1].getLineNumber();
    }

    public static void e(String message){
        if (!isDebuggable())
            return;

        // Throwable instance must be created before any methods
        getMethodNames(new Throwable().getStackTrace());
        Log.e(className, createLog(message));
    }

    public static void i(String message){
        if (!isDebuggable())
            return;

        getMethodNames(new Throwable().getStackTrace());
        Log.i(className, createLog(message));
    }

    public static void d(String message){
        if (!isDebuggable())
            return;

        getMethodNames(new Throwable().getStackTrace());
        Log.d(className, createLog(message));
    }

    public static void d(){
        d("");
    }

    public static void v(String message){
        if (!isDebuggable())
            return;

        getMethodNames(new Throwable().getStackTrace());
        Log.v(className, createLog(message));
    }

    public static void w(String message){
        if (!isDebuggable())
            return;

        getMethodNames(new Throwable().getStackTrace());
        Log.w(className, createLog(message));
    }

    public static void wtf(String message){
        if (!isDebuggable())
            return;

        getMethodNames(new Throwable().getStackTrace());
        Log.wtf(className, createLog(message));
    }

}

================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/PreferenceUtils.java
================================================
package com.lguipeng.notes.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.lguipeng.notes.ui.fragments.SettingFragment;

/**
 * Created by lgp on 2014/10/30.
 */
public class PreferenceUtils{

    private SharedPreferences sharedPreferences;

    private SharedPreferences.Editor shareEditor;

    private static PreferenceUtils preferenceUtils = null;

    public static final String NOTE_TYPE_KEY = "NOTE_TYPE_KEY";

    private PreferenceUtils(Context context){
        sharedPreferences = context.getSharedPreferences(SettingFragment.PREFERENCE_FILE_NAME, Context.MODE_PRIVATE);
        shareEditor = sharedPreferences.edit();
    }

    public static PreferenceUtils getInstance(Context context){
        if (preferenceUtils == null) {
            synchronized (PreferenceUtils.class) {
                if (preferenceUtils == null) {
                    preferenceUtils = new PreferenceUtils(context.getApplicationContext());
                }
            }
        }
        return preferenceUtils;
    }

    public String getStringParam(String key){
        return getStringParam(key, "");
    }

    public String getStringParam(String key, String defaultString){
        return sharedPreferences.getString(key, defaultString);
    }

    public void saveParam(String key, String value)
    {
        shareEditor.putString(key,value).commit();
    }

    public boolean getBooleanParam(String key){
        return getBooleanParam(key, false);
    }

    public boolean getBooleanParam(String key, boolean defaultBool){
        return sharedPreferences.getBoolean(key, defaultBool);
    }

    public void saveParam(String key, boolean value){
        shareEditor.putBoolean(key, value).commit();
    }

    public int getIntParam(String key){
        return getIntParam(key, 0);
    }

    public int getIntParam(String key, int defaultInt){
        return sharedPreferences.getInt(key, defaultInt);
    }

    public void saveParam(String key, int value){
        shareEditor.putInt(key, value).commit();
    }

    public long getLongParam(String key){
        return getLongParam(key, 0);
    }

    public long getLongParam(String key, long defaultInt){
        return sharedPreferences.getLong(key, defaultInt);
    }

    public void saveParam(String key, long value){
        shareEditor.putLong(key, value).commit();
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/SnackbarUtils.java
================================================
package com.lguipeng.notes.utils;

import android.app.Activity;
import android.graphics.Color;

import com.lguipeng.notes.ui.BaseActivity;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

/**
 * Author: lgp
 * Date: 2014/12/31.
 */
public class SnackbarUtils {

    public static void show(Activity activity, int message) {
//        Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
//        Toast toast = new Toast(mContext);
//        View view = LayoutInflater.from(mContext).inflate(R.layout.toast_layout, null, false);
//        TextView textView = (TextView)view.findViewById(R.id.toast_text);
//        textView.setText(message);
//        toast.setView(view);
//        toast.setDuration(Toast.LENGTH_SHORT);
//        toast.show();
        int color = Color.BLACK;
        if (activity instanceof BaseActivity){
            color = (((BaseActivity) activity)).getColorPrimary();
        }
        color = color & 0xddffffff;
        SnackbarManager.show(
                Snackbar.with(activity.getApplicationContext())
                        .color(color)
                        .duration((Snackbar.SnackbarDuration.LENGTH_SHORT.getDuration() / 2))
                        .text(message), activity);
    }

}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/ThemeUtils.java
================================================
package com.lguipeng.notes.utils;

import android.app.Activity;

import com.lguipeng.notes.R;

/**
 * Created by lgp on 2015/6/7.
 */
public class ThemeUtils {

    public static void changTheme(Activity activity, Theme theme){
        if (activity == null)
            return;
        int style = R.style.RedTheme;
        switch (theme){
            case BROWN:
                style = R.style.BrownTheme;
                break;
            case BLUE:
                style = R.style.BlueTheme;
                break;
            case BLUE_GREY:
                style = R.style.BlueGreyTheme;
                break;
            case YELLOW:
                style = R.style.YellowTheme;
                break;
            case DEEP_PURPLE:
                style = R.style.DeepPurpleTheme;
                break;
            case PINK:
                style = R.style.PinkTheme;
                break;
            case GREEN:
                style = R.style.GreenTheme;
                break;
            default:
                break;
        }
        activity.setTheme(style);
    }

    public enum Theme{
        RED(0x00),
        BROWN(0x01),
        BLUE(0x02),
        BLUE_GREY(0x03),
        YELLOW(0x04),
        DEEP_PURPLE(0x05),
        PINK(0x06),
        GREEN(0x07);

        private int mValue;

        Theme(int value){
            this.mValue = value;
        }

        public static Theme mapValueToTheme(final int value) {
            for (Theme theme : Theme.values()) {
                if (value == theme.getIntValue()) {
                    return theme;
                }
            }
            // If run here, return default
            return RED;
        }

        static Theme getDefault()
        {
            return RED;
        }
        public int getIntValue() {
            return mValue;
        }
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/TimeUtils.java
================================================
package com.lguipeng.notes.utils;

import android.content.Context;

import com.lguipeng.notes.R;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lgp on 2015/5/25.
 */
public class TimeUtils {
    public static final long DAY_Millis = 24 * 60 * 60 * 1000;
    public static final long MONTH_Millis = 30 * DAY_Millis;
    public static final long YEAR_Millis = 365 * DAY_Millis;
    public static final SimpleDateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("yyyy.MM.dd    HH : mm");
    public static final SimpleDateFormat DATE_FORMAT_DATE_1    = new SimpleDateFormat(" HH : mm ");

    private TimeUtils() {
        throw new AssertionError();
    }

    /**
     * long time to string
     *
     * @param timeInMillis
     * @param dateFormat
     * @return
     */
    public static String getTime(long timeInMillis, SimpleDateFormat dateFormat) {
        return dateFormat.format(new Date(timeInMillis));
    }

    /**
     * long time to string, format is {@link #DEFAULT_DATE_FORMAT}
     *
     * @param timeInMillis
     * @return
     */
    public static String getTime(long timeInMillis) {
        return getTime(timeInMillis, DEFAULT_DATE_FORMAT);
    }

    @SuppressWarnings("Deprecated")
    public static String getConciseTime(long timeInMillis, long nowInMillis, Context context) {
        if (context == null)
            return "";
        Date date = new Date(timeInMillis);
        Date now = new Date(nowInMillis);

        if (now.getYear() == date.getYear()) {
            if (now.getMonth() == date.getMonth()) {
                if (now.getDate() == date.getDate())
                    return context.getString(R.string.today, getTime(timeInMillis, DATE_FORMAT_DATE_1));
                else{
                    return context.getString(R.string.before_day, now.getDate() - date.getDate());
                }
            }else {
                return context.getString(R.string.before_month, now.getMonth() - date.getMonth());
            }
        }
        return context.getString(R.string.before_year, now.getYear() - date.getYear());
    }


    public static String getConciseTime(long timeInMillis, Context context) {
        return getConciseTime(timeInMillis, getCurrentTimeInLong(), context);
    }
    /**
     * get current time in milliseconds
     *
     * @return
     */
    public static long getCurrentTimeInLong() {
        return System.currentTimeMillis();
    }

    /**
     * get current time in milliseconds, format is {@link #DEFAULT_DATE_FORMAT}
     *
     * @return
     */
    public static String getCurrentTimeInString() {
        return getTime(getCurrentTimeInLong());
    }

    /**
     * get current time in milliseconds
     *
     * @return
     */
    public static String getCurrentTimeInString(SimpleDateFormat dateFormat) {
        return getTime(getCurrentTimeInLong(), dateFormat);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/ViewHelper.java
================================================
package com.lguipeng.notes.utils;

import android.support.v4.view.ViewCompat;
import android.view.View;

/**
 * Created by lgp on 2015/5/27.
 */
public class ViewHelper {
    public static void clear(View v) {
        ViewCompat.setAlpha(v, 1);
        ViewCompat.setScaleY(v, 1);
        ViewCompat.setScaleX(v, 1);
        ViewCompat.setTranslationY(v, 0);
        ViewCompat.setTranslationX(v, 0);
        ViewCompat.setRotation(v, 0);
        ViewCompat.setRotationY(v, 0);
        ViewCompat.setRotationX(v, 0);
        // @TODO https://code.google.com/p/android/issues/detail?id=80863
//        ViewCompat.setPivotY(v, v.getMeasuredHeight() / 2);
        v.setPivotY(v.getMeasuredHeight() / 2);
        ViewCompat.setPivotX(v, v.getMeasuredWidth() / 2);
        ViewCompat.animate(v).setInterpolator(null);
    }
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/utils/WXUtils.java
================================================
package com.lguipeng.notes.utils;

import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;

import junit.framework.Assert;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class WXUtils {
	
	public static byte[] bmpToByteArray(final Bitmap bmp, final boolean needRecycle) {
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		bmp.compress(CompressFormat.PNG, 100, output);
		if (needRecycle) {
			bmp.recycle();
		}
		
		byte[] result = output.toByteArray();
		try {
			output.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return result;
	}
	
	public static byte[] getHtmlByteArray(final String url) {
		 URL htmlUrl = null;     
		 InputStream inStream = null;     
		 try {         
			 htmlUrl = new URL(url);         
			 URLConnection connection = htmlUrl.openConnection();         
			 HttpURLConnection httpConnection = (HttpURLConnection)connection;         
			 int responseCode = httpConnection.getResponseCode();         
			 if(responseCode == HttpURLConnection.HTTP_OK){             
				 inStream = httpConnection.getInputStream();         
			  }     
			 } catch (MalformedURLException e) {               
				 e.printStackTrace();     
			 } catch (IOException e) {              
				e.printStackTrace();    
		  } 
		byte[] data = inputStreamToByte(inStream);

		return data;
	}
	
	public static byte[] inputStreamToByte(InputStream is) {
		try{
			ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
			int ch;
			while ((ch = is.read()) != -1) {
				bytestream.write(ch);
			}
			byte imgdata[] = bytestream.toByteArray();
			bytestream.close();
			return imgdata;
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return null;
	}
	
	public static byte[] readFromFile(String fileName, int offset, int len) {
		if (fileName == null) {
			return null;
		}

		File file = new File(fileName);
		if (!file.exists()) {
			NotesLog.i("readFromFile: file not found");
			return null;
		}

		if (len == -1) {
			len = (int) file.length();
		}

		NotesLog.d("readFromFile : offset = " + offset + " len = " + len + " offset + len = " + (offset + len));

		if(offset <0){
			NotesLog.e("readFromFile invalid offset:" + offset);
			return null;
		}
		if(len <=0 ){
			NotesLog.e("readFromFile invalid len:" + len);
			return null;
		}
		if(offset + len > (int) file.length()){
			NotesLog.e("readFromFile invalid file len:" + file.length());
			return null;
		}

		byte[] b = null;
		try {
			RandomAccessFile in = new RandomAccessFile(fileName, "r");
			b = new byte[len];
			in.seek(offset);
			in.readFully(b);
			in.close();

		} catch (Exception e) {
			NotesLog.e("readFromFile : errMsg = " + e.getMessage());
			e.printStackTrace();
		}
		return b;
	}
	
	private static final int MAX_DECODE_PICTURE_SIZE = 1920 * 1440;
	public static Bitmap extractThumbNail(final String path, final int height, final int width, final boolean crop) {
		Assert.assertTrue(path != null && !path.equals("") && height > 0 && width > 0);

		BitmapFactory.Options options = new BitmapFactory.Options();

		try {
			options.inJustDecodeBounds = true;
			Bitmap tmp = BitmapFactory.decodeFile(path, options);
			if (tmp != null) {
				tmp.recycle();
				tmp = null;
			}

			NotesLog.d("extractThumbNail: round=" + width + "x" + height + ", crop=" + crop);
			final double beY = options.outHeight * 1.0 / height;
			final double beX = options.outWidth * 1.0 / width;
			NotesLog.d("extractThumbNail: extract beX = " + beX + ", beY = " + beY);
			options.inSampleSize = (int) (crop ? (beY > beX ? beX : beY) : (beY < beX ? beX : beY));
			if (options.inSampleSize <= 1) {
				options.inSampleSize = 1;
			}

			// NOTE: out of memory error
			while (options.outHeight * options.outWidth / options.inSampleSize > MAX_DECODE_PICTURE_SIZE) {
				options.inSampleSize++;
			}

			int newHeight = height;
			int newWidth = width;
			if (crop) {
				if (beY > beX) {
					newHeight = (int) (newWidth * 1.0 * options.outHeight / options.outWidth);
				} else {
					newWidth = (int) (newHeight * 1.0 * options.outWidth / options.outHeight);
				}
			} else {
				if (beY < beX) {
					newHeight = (int) (newWidth * 1.0 * options.outHeight / options.outWidth);
				} else {
					newWidth = (int) (newHeight * 1.0 * options.outWidth / options.outHeight);
				}
			}

			options.inJustDecodeBounds = false;

			NotesLog.i("bitmap required size=" + newWidth + "x" + newHeight + ", orig=" + options.outWidth + "x" + options.outHeight + ", sample=" + options.inSampleSize);
			Bitmap bm = BitmapFactory.decodeFile(path, options);
			if (bm == null) {
				NotesLog.e("bitmap decode failed");
				return null;
			}

			NotesLog.i("bitmap decoded size=" + bm.getWidth() + "x" + bm.getHeight());
			final Bitmap scale = Bitmap.createScaledBitmap(bm, newWidth, newHeight, true);
			if (scale != null) {
				bm.recycle();
				bm = scale;
			}

			if (crop) {
				final Bitmap cropped = Bitmap.createBitmap(bm, (bm.getWidth() - width) >> 1, (bm.getHeight() - height) >> 1, width, height);
				if (cropped == null) {
					return bm;
				}

				bm.recycle();
				bm = cropped;
				NotesLog.i("bitmap croped size=" + bm.getWidth() + "x" + bm.getHeight());
			}
			return bm;

		} catch (final OutOfMemoryError e) {
			NotesLog.e("decode bitmap failed: " + e.getMessage());
			options = null;
		}

		return null;
	}
}


================================================
FILE: app/src/main/java/com/lguipeng/notes/view/FixedRecyclerView.java
================================================
package com.lguipeng.notes.view;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;

/**
 * Created by lgp on 2015/6/11.
 */
public class FixedRecyclerView extends RecyclerView {
    public FixedRecyclerView(Context context) {
        super(context);
    }

    public FixedRecyclerView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public FixedRecyclerView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean canScrollVertically(int direction) {
        // check if scrolling up
        if (direction < 1) {
            boolean original = super.canScrollVertically(direction);
            return !original && getChildAt(0) != null && getChildAt(0).getTop() < 0 || original;
        }
        return super.canScrollVertically(direction);

    }
}


================================================
FILE: app/src/main/res/drawable/activated_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_activated="true" android:drawable="@drawable/abc_list_pressed_holo_dark" />
    <item android:state_pressed="true" android:drawable="@drawable/abc_list_pressed_holo_dark" />
    <item android:state_long_pressable="true" android:drawable="@drawable/abc_list_pressed_holo_dark" />
    <item  android:drawable="@android:color/transparent" />
</selector>

================================================
FILE: app/src/main/res/drawable/blue_grey_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/blue_grey"/>
</shape>

================================================
FILE: app/src/main/res/drawable/blue_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/blue"/>
</shape>

================================================
FILE: app/src/main/res/drawable/brown_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/brown"/>
</shape>

================================================
FILE: app/src/main/res/drawable/deep_purple_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/deep_purple"/>
</shape>

================================================
FILE: app/src/main/res/drawable/green_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/green"/>
</shape>

================================================
FILE: app/src/main/res/drawable/pink_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/pink"/>
</shape>

================================================
FILE: app/src/main/res/drawable/red_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="@color/red"/>
</shape>

================================================
FILE: app/src/main/res/drawable/selectable_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/abc_list_pressed_holo_dark" />
    <item  android:dr
Download .txt
gitextract_lccwb36e/

├── .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
│           ├── 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/
│               │   ├── 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
│               ├── values/
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   └── styles.xml
│               └── xml/
│                   ├── prefs.xml
│                   └── searchable.xml
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.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
└── settings.gradle
Download .txt
SYMBOL INDEX (898 symbols across 75 files)

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/CheckBoxPreference.java
  class CheckBoxPreference (line 11) | public class CheckBoxPreference extends TwoStatePreference {
    method CheckBoxPreference (line 13) | public CheckBoxPreference(Context context) {
    method CheckBoxPreference (line 18) | public CheckBoxPreference(Context context, AttributeSet attrs) {
    method CheckBoxPreference (line 23) | public CheckBoxPreference(Context context, AttributeSet attrs, int def...
    method CheckBoxPreference (line 28) | public CheckBoxPreference(Context context, AttributeSet attrs, int def...
    method init (line 34) | private void init(Context context, AttributeSet attrs, int defStyleAtt...
    method onBindView (line 48) | @Override @SuppressWarnings("deprecation")

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/Preference.java
  class Preference (line 21) | public class Preference extends android.preference.Preference {
    method Preference (line 32) | public Preference(Context context) {
    method Preference (line 37) | public Preference(Context context, AttributeSet attrs) {
    method Preference (line 42) | public Preference(Context context, AttributeSet attrs, int defStyleAtt...
    method Preference (line 47) | @TargetApi(LOLLIPOP)
    method init (line 53) | private void init(Context context, AttributeSet attrs, int defStyleAtt...
    method onCreateView (line 61) | @Override
    method onBindView (line 77) | @Override
    method setIcon (line 104) | @Override
    method setIcon (line 110) | @Override

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceCategory.java
  class PreferenceCategory (line 19) | public class PreferenceCategory extends android.preference.PreferenceCat...
    method PreferenceCategory (line 23) | public PreferenceCategory(Context context) {
    method PreferenceCategory (line 28) | public PreferenceCategory(Context context, AttributeSet attrs) {
    method PreferenceCategory (line 33) | public PreferenceCategory(Context context, AttributeSet attrs, int def...
    method PreferenceCategory (line 38) | @TargetApi(LOLLIPOP)
    method init (line 45) | private void init() {
    method onCreateView (line 49) | @Override
    method onBindView (line 56) | @Override

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceImageView.java
  class PreferenceImageView (line 19) | public class PreferenceImageView extends ImageView {
    method PreferenceImageView (line 24) | public PreferenceImageView(Context context) {
    method PreferenceImageView (line 28) | public PreferenceImageView(Context context, AttributeSet attrs) {
    method PreferenceImageView (line 32) | public PreferenceImageView(Context context, AttributeSet attrs, int de...
    method PreferenceImageView (line 36) | @TargetApi(LOLLIPOP)
    method setMaxWidth (line 42) | @Override
    method setMaxHeight (line 48) | @Override
    method onMeasure (line 54) | @Override

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/SwitchPreference.java
  class SwitchPreference (line 9) | public class SwitchPreference extends TwoStatePreference {
    method SwitchPreference (line 11) | public SwitchPreference(Context context) {
    method SwitchPreference (line 16) | public SwitchPreference(Context context, AttributeSet attrs) {
    method SwitchPreference (line 21) | public SwitchPreference(Context context, AttributeSet attrs, int defSt...
    method SwitchPreference (line 26) | public SwitchPreference(Context context, AttributeSet attrs, int defSt...
    method init (line 31) | private void init(Context context, AttributeSet attrs, int defStyleAtt...
    method onBindView (line 45) | @Override

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/ThemeUtils.java
  class ThemeUtils (line 12) | final class ThemeUtils {
    method ThemeUtils (line 17) | private ThemeUtils() {
    method isAtLeastL (line 21) | static boolean isAtLeastL() {
    method resolveAccentColor (line 25) | @TargetApi(LOLLIPOP)

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/TwoStatePreference.java
  class TwoStatePreference (line 13) | public abstract class TwoStatePreference extends Preference {
    method TwoStatePreference (line 21) | public TwoStatePreference(Context context) {
    method TwoStatePreference (line 25) | public TwoStatePreference(Context context, AttributeSet attrs) {
    method TwoStatePreference (line 29) | public TwoStatePreference(Context context, AttributeSet attrs, int def...
    method TwoStatePreference (line 33) | public TwoStatePreference(Context context, AttributeSet attrs, int def...
    method onClick (line 38) | @Override
    method setChecked (line 54) | public void setChecked(boolean checked) {
    method isChecked (line 73) | public boolean isChecked() {
    method shouldDisableDependents (line 77) | @Override
    method setSummaryOn (line 89) | public void setSummaryOn(CharSequence summary) {
    method setSummaryOn (line 102) | public void setSummaryOn(int summaryResId) {
    method getSummaryOn (line 111) | public CharSequence getSummaryOn() {
    method setSummaryOff (line 121) | public void setSummaryOff(CharSequence summary) {
    method setSummaryOff (line 134) | public void setSummaryOff(int summaryResId) {
    method getSummaryOff (line 143) | public CharSequence getSummaryOff() {
    method getDisableDependentsState (line 154) | public boolean getDisableDependentsState() {
    method setDisableDependentsState (line 165) | public void setDisableDependentsState(boolean disableDependentsState) {
    method onGetDefaultValue (line 169) | @Override
    method onSetInitialValue (line 174) | @Override
    method syncSummaryView (line 185) | void syncSummaryView(View view) {
    method onSaveInstanceState (line 214) | @Override
    method onRestoreInstanceState (line 227) | @Override
    class SavedState (line 240) | static class SavedState extends BaseSavedState {
      method SavedState (line 244) | public SavedState(Parcel source) {
      method writeToParcel (line 249) | @Override
      method SavedState (line 255) | public SavedState(Parcelable superState) {
      method createFromParcel (line 260) | public SavedState createFromParcel(Parcel in) {
      method newArray (line 264) | public SavedState[] newArray(int size) {

FILE: MaterialPreference/src/main/java/com/jenzz/materialpreference/Typefaces.java
  class Typefaces (line 8) | final class Typefaces {
    method Typefaces (line 13) | private Typefaces() {
    method get (line 17) | static Typeface get(Context context, String assetPath) {
    method getRobotoRegular (line 32) | static Typeface getRobotoRegular(Context context) {
    method getRobotoMedium (line 36) | static Typeface getRobotoMedium(Context context) {

FILE: app/src/androidTest/java/com/lguipeng/notes/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: app/src/main/java/com/lguipeng/notes/App.java
  class App (line 16) | public class App extends Application{
    method onCreate (line 18) | @Override
    method onTerminate (line 26) | @Override
    method onLowMemory (line 31) | @Override
    method getModules (line 36) | private List<Object> getModules() {
    method createScopedGraph (line 40) | public ObjectGraph createScopedGraph(Object... modules) {

FILE: app/src/main/java/com/lguipeng/notes/adpater/BaseListAdapter.java
  class BaseListAdapter (line 16) | @SuppressLint("UseSparseArrays")
    method getList (line 25) | public List<E> getList() {
    method setList (line 29) | public void setList(List<E> list) {
    method add (line 34) | public void add(E e) {
    method addAll (line 39) | public void addAll(List<E> list) {
    method remove (line 44) | public void remove(int position) {
    method BaseListAdapter (line 49) | public BaseListAdapter(Context context, List<E> list) {
    method getCount (line 56) | @Override
    method getItem (line 61) | @Override
    method getItemId (line 66) | @Override
    method getView (line 71) | public View getView(int position, View convertView, ViewGroup parent) {
    method bindView (line 77) | public abstract View bindView(int position, View convertView,
    method addInternalClickListener (line 82) | private void addInternalClickListener(final View itemV, final Integer ...
    method setOnInViewClickListener (line 108) | public void setOnInViewClickListener(Integer key,
    type onInternalClickListener (line 115) | public interface onInternalClickListener<T> {
      method OnClickListener (line 116) | void OnClickListener(View parentV, View v, Integer position,
      method OnLongClickListener (line 118) | void OnLongClickListener(View parentV, View v, Integer position,
    class onInternalClickListenerImpl (line 122) | public static class onInternalClickListenerImpl<T> implements onIntern...
      method OnClickListener (line 123) | @Override
      method OnLongClickListener (line 128) | @Override

FILE: app/src/main/java/com/lguipeng/notes/adpater/BaseRecyclerViewAdapter.java
  class BaseRecyclerViewAdapter (line 20) | public abstract class BaseRecyclerViewAdapter<E> extends RecyclerView.Ad...
    method BaseRecyclerViewAdapter (line 34) | public BaseRecyclerViewAdapter(List<E> list) {
    method BaseRecyclerViewAdapter (line 38) | public BaseRecyclerViewAdapter(List<E> list, Context context) {
    method add (line 43) | public void add(E e) {
    method remove (line 48) | public void remove(E e) {
    method remove (line 53) | public void remove(int position) {
    method setList (line 59) | public void setList(List<E> list) {
    method getList (line 65) | public List<E> getList() {
    method getItemCount (line 69) | @Override
    method onCreateViewHolder (line 74) | @Override
    method onBindViewHolder (line 79) | @Override
    method getItemViewType (line 86) | @Override
    method addInternalClickListener (line 91) | private void addInternalClickListener(final View itemV, final Integer ...
    method setOnInViewClickListener (line 117) | public void setOnInViewClickListener(Integer key, onInternalClickListe...
    type onInternalClickListener (line 123) | public interface onInternalClickListener<T> {
      method OnClickListener (line 124) | void OnClickListener(View parentV, View v, Integer position,
      method OnLongClickListener (line 126) | void OnLongClickListener(View parentV, View v, Integer position,
    class onInternalClickListenerImpl (line 130) | public static class onInternalClickListenerImpl<T> implements onIntern...
      method OnClickListener (line 131) | @Override
      method OnLongClickListener (line 136) | @Override
    method setDuration (line 142) | public void setDuration(int duration) {
    method setInterpolator (line 146) | public void setInterpolator(Interpolator interpolator) {
    method setStartPosition (line 150) | public void setStartPosition(int start) {
    method setFirstOnly (line 154) | public void setFirstOnly(boolean firstOnly) {
    method animate (line 158) | protected void animate(RecyclerView.ViewHolder holder, int position){
    method getAnimators (line 171) | protected abstract Animator[] getAnimators(View view);

FILE: app/src/main/java/com/lguipeng/notes/adpater/ColorsListAdapter.java
  class ColorsListAdapter (line 16) | public class ColorsListAdapter extends BaseListAdapter<Integer>{
    method ColorsListAdapter (line 20) | public ColorsListAdapter(Context context, List<Integer> list) {
    method bindView (line 24) | @Override
    method getCheckItem (line 43) | public int getCheckItem() {
    method setCheckItem (line 47) | public void setCheckItem(int checkItem) {
    class Holder (line 51) | static class Holder {

FILE: app/src/main/java/com/lguipeng/notes/adpater/DrawerListAdapter.java
  class DrawerListAdapter (line 12) | public class DrawerListAdapter extends SimpleListAdapter{
    method DrawerListAdapter (line 14) | public DrawerListAdapter(Context mContext, List<String> list) {
    method getLayout (line 18) | @Override

FILE: app/src/main/java/com/lguipeng/notes/adpater/MaterialSimpleListAdapter.java
  class MaterialSimpleListAdapter (line 16) | public class MaterialSimpleListAdapter extends ArrayAdapter<MaterialSimp...
    method MaterialSimpleListAdapter (line 18) | public MaterialSimpleListAdapter(Context context) {
    method getView (line 22) | @Override

FILE: app/src/main/java/com/lguipeng/notes/adpater/NotesAdapter.java
  class NotesAdapter (line 24) | public class NotesAdapter extends BaseRecyclerViewAdapter<Note> implemen...
    method NotesAdapter (line 28) | public NotesAdapter(List<Note> list) {
    method NotesAdapter (line 33) | public NotesAdapter(List<Note> list, Context context) {
    method onCreateViewHolder (line 38) | @Override
    method onBindViewHolder (line 45) | @Override
    method getFilter (line 58) | @Override
    method getAnimators (line 63) | @Override
    method setList (line 77) | @Override
    method setDownFactor (line 86) | public void setDownFactor(){
    method setUpFactor (line 91) | public void setUpFactor(){
    class NoteFilter (line 96) | private static class NoteFilter extends Filter{
      method NoteFilter (line 104) | private NoteFilter(NotesAdapter adapter, List<Note> originalList) {
      method performFiltering (line 111) | @Override
      method publishResults (line 129) | @Override

FILE: app/src/main/java/com/lguipeng/notes/adpater/NotesItemViewHolder.java
  class NotesItemViewHolder (line 13) | public class NotesItemViewHolder extends RecyclerView.ViewHolder{
    method NotesItemViewHolder (line 18) | public NotesItemViewHolder(View parent) {
    method setLabelText (line 25) | public void setLabelText(CharSequence text){
    method setLabelText (line 29) | public void setLabelText(int text){
    method setContentText (line 33) | public void setContentText(CharSequence text){
    method setContentText (line 37) | public void setContentText(int text){
    method setTimeText (line 41) | public void setTimeText(CharSequence text){
    method setTimeText (line 45) | public void setTimeText(int text){
    method setTextView (line 49) | private void setTextView(TextView view, CharSequence text){
    method setTextView (line 55) | private void setTextView(TextView view, int text){

FILE: app/src/main/java/com/lguipeng/notes/adpater/SimpleListAdapter.java
  class SimpleListAdapter (line 16) | public abstract class SimpleListAdapter extends BaseListAdapter<String> {
    method SimpleListAdapter (line 18) | public SimpleListAdapter(Context mContext, List<String> list) {
    method bindView (line 22) | @Override
    method getLayout (line 37) | protected abstract int getLayout();
    class Holder (line 39) | static class Holder {

FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/FindListenerImpl.java
  class FindListenerImpl (line 12) | public class FindListenerImpl<T> extends FindListener<T> {
    method onSuccess (line 13) | @Override
    method onError (line 18) | @Override

FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/SaveListenerImpl.java
  class SaveListenerImpl (line 10) | public class SaveListenerImpl extends SaveListener {
    method onSuccess (line 11) | @Override
    method onFailure (line 16) | @Override

FILE: app/src/main/java/com/lguipeng/notes/listener/bmob/UpdateListenerImpl.java
  class UpdateListenerImpl (line 10) | public class UpdateListenerImpl extends UpdateListener {
    method onSuccess (line 11) | @Override
    method onFailure (line 16) | @Override

FILE: app/src/main/java/com/lguipeng/notes/listener/view/RecyclerViewClickListener.java
  type RecyclerViewClickListener (line 9) | public interface RecyclerViewClickListener {
    method onClick (line 19) | void onClick(View v, int position, float x, float y);

FILE: app/src/main/java/com/lguipeng/notes/model/CloudNote.java
  class CloudNote (line 13) | public class CloudNote extends BmobObject {
    method CloudNote (line 15) | public CloudNote() {
    method CloudNote (line 19) | public CloudNote(String theClassName) {
    method getVersion (line 31) | public long getVersion() {
    method setVersion (line 35) | public void setVersion(long version) {
    method getNoteType (line 39) | public String getNoteType() {
    method setNoteType (line 43) | public void setNoteType(String noteType) {
    method getEmail (line 47) | public String getEmail() {
    method setEmail (line 51) | public void setEmail(String email) {
    method getNoteList (line 55) | public List<String> getNoteList() {
    method setNoteList (line 59) | public void setNoteList(List<String> noteList) {
    method addNote (line 63) | public void addNote(Note note) {
    method clearNotes (line 67) | public void clearNotes() {
    method toString (line 71) | @Override

FILE: app/src/main/java/com/lguipeng/notes/model/MaterialSimpleListItem.java
  class MaterialSimpleListItem (line 12) | public class MaterialSimpleListItem {
    method MaterialSimpleListItem (line 16) | private MaterialSimpleListItem(Builder builder) {
    method getIcon (line 20) | public Drawable getIcon() {
    method getContent (line 24) | public CharSequence getContent() {
    class Builder (line 28) | public static class Builder {
      method Builder (line 34) | public Builder(Context context) {
      method icon (line 38) | public Builder icon(Drawable icon) {
      method icon (line 43) | public Builder icon(@DrawableRes int iconRes) {
      method content (line 49) | public Builder content(CharSequence content) {
      method content (line 54) | public Builder content(@StringRes int contentRes) {
      method build (line 58) | public MaterialSimpleListItem build() {
    method toString (line 63) | @Override

FILE: app/src/main/java/com/lguipeng/notes/model/Note.java
  class Note (line 15) | @Table(name = "notes")
    method getId (line 27) | public int getId() {
    method setId (line 31) | public void setId(int id) {
    method getLabel (line 35) | public String getLabel() {
    method setLabel (line 39) | public void setLabel(String label) {
    method getContent (line 43) | public String getContent() {
    method setContent (line 47) | public void setContent(String content) {
    method getLastOprTime (line 51) | public long getLastOprTime() {
    method setLastOprTime (line 55) | public void setLastOprTime(long lastOprTime) {
    method getType (line 59) | public int getType() {
    method setType (line 63) | public void setType(int type) {
    method getLogs (line 67) | public OneToManyLazyLoader<Note, NoteOperateLog> getLogs() {
    method setLogs (line 71) | public void setLogs(OneToManyLazyLoader<Note, NoteOperateLog> logs) {
    method toString (line 75) | @Override

FILE: app/src/main/java/com/lguipeng/notes/model/NoteOperateLog.java
  class NoteOperateLog (line 11) | @Table(name = "note_opr_log")
    method getId (line 19) | public int getId() {
    method setId (line 23) | public void setId(int id) {
    method getType (line 27) | public int getType() {
    method setType (line 31) | public void setType(int type) {
    method getTime (line 35) | public long getTime() {
    method setTime (line 39) | public void setTime(long time) {
    method getNote (line 43) | public Note getNote() {
    method setNote (line 47) | public void setNote(Note note) {

FILE: app/src/main/java/com/lguipeng/notes/model/NoteType.java
  class NoteType (line 13) | public class NoteType{
    method addType (line 20) | public void addType(String type){
    method getType (line 26) | public String getType(int location){
    method getTypes (line 33) | public List<String> getTypes() {
    method setTypes (line 37) | public void setTypes(List<String> types) {

FILE: app/src/main/java/com/lguipeng/notes/module/AppModule.java
  class AppModule (line 14) | @Module(
    method AppModule (line 23) | public AppModule(App app) {
    method provideApplication (line 27) | @Provides
    method provideContext (line 32) | @Provides

FILE: app/src/main/java/com/lguipeng/notes/module/DataModule.java
  class DataModule (line 23) | @Module(
    method provideDaoConfig (line 38) | @Provides @Singleton
    method provideFinalDb (line 48) | @Provides @Singleton

FILE: app/src/main/java/com/lguipeng/notes/ui/AboutActivity.java
  class AboutActivity (line 45) | public class AboutActivity extends BaseActivity implements View.OnClickL...
    method onCreate (line 57) | @Override
    method getLayoutView (line 65) | @Override
    method getModules (line 70) | @Override
    method onClick (line 75) | @Override
    method initToolbar (line 89) | @Override
    method versionClick (line 96) | @OnClick(R.id.version_text)
    method initVersionText (line 116) | private void initVersionText(){
    method onCreateOptionsMenu (line 120) | @Override
    method onOptionsItemSelected (line 126) | @Override
    method getVersion (line 138) | private String getVersion(Context ctx){
    method startViewAction (line 150) | private void startViewAction(String uriStr){
    method share (line 160) | private void share(String packages, Uri uri){
    method getLogoBitmapArray (line 176) | private byte[] getLogoBitmapArray(){
    method shareToWeChat (line 181) | private void shareToWeChat(int scene){
    method shareToWeChatTimeline (line 201) | private void shareToWeChatTimeline(){
    method shareToWeChatSession (line 205) | private void shareToWeChatSession(){
    method shareToWeChatFavorite (line 209) | private void shareToWeChatFavorite(){
    method shareToWeibo (line 213) | private void shareToWeibo(){
    method isInstallApplication (line 221) | private boolean isInstallApplication(String packageName){
    method showShareDialog (line 231) | private void showShareDialog(){

FILE: app/src/main/java/com/lguipeng/notes/ui/BaseActivity.java
  class BaseActivity (line 27) | public abstract class BaseActivity extends AppCompatActivity {
    method onCreate (line 33) | @Override
    method initTheme (line 46) | private void initTheme(){
    method getColor (line 51) | protected int getColor(int res){
    method initWindow (line 57) | @TargetApi(19)
    method initToolbar (line 68) | protected void initToolbar(Toolbar toolbar){
    method getStatusBarColor (line 82) | public int getStatusBarColor(){
    method getColorPrimary (line 86) | public int getColorPrimary(){
    method getDarkColorPrimary (line 92) | public int getDarkColorPrimary(){
    method generateDialogBuilder (line 98) | protected AlertDialog.Builder generateDialogBuilder(){
    method getCurrentTheme (line 131) | protected ThemeUtils.Theme getCurrentTheme(){
    method onDestroy (line 136) | @Override
    method onOptionsItemSelected (line 145) | @Override
    method getLayoutView (line 158) | protected abstract int getLayoutView();
    method getModules (line 160) | protected abstract List<Object> getModules();
    method initToolbar (line 162) | protected abstract void initToolbar();

FILE: app/src/main/java/com/lguipeng/notes/ui/EditNoteTypeActivity.java
  class EditNoteTypeActivity (line 32) | public class EditNoteTypeActivity extends BaseActivity{
    method onCreate (line 43) | @Override
    method onCreateOptionsMenu (line 49) | @Override
    method onPrepareOptionsMenu (line 55) | @Override
    method onOptionsItemSelected (line 62) | @Override
    method getLayoutView (line 83) | @Override
    method getModules (line 88) | @Override
    method initToolbar (line 93) | @Override
    method initEditTextView (line 99) | private void initEditTextView(){
    class SimpleTextWatcher (line 116) | class SimpleTextWatcher implements TextWatcher {
      method beforeTextChanged (line 118) | @Override
      method onTextChanged (line 123) | @Override
      method afterTextChanged (line 139) | @Override
    method hideKeyBoard (line 145) | private void hideKeyBoard(EditText editText){

FILE: app/src/main/java/com/lguipeng/notes/ui/MainActivity.java
  class MainActivity (line 69) | public class MainActivity extends BaseActivity implements SwipeRefreshLa...
    method onCreate (line 125) | @Override
    method onSaveInstanceState (line 138) | @Override
    method onStart (line 146) | @Override
    method onResume (line 160) | @Override
    method onStop (line 172) | @Override
    method onDestroy (line 177) | @Override
    method onEvent (line 183) | public void onEvent(Integer event){
    method getLayoutView (line 197) | @Override
    method getModules (line 202) | @Override
    method onConfigurationChanged (line 207) | @Override
    method onPostCreate (line 213) | @Override
    method onCreateOptionsMenu (line 227) | @Override
    method onOptionsItemSelected (line 269) | @Override
    method onKeyDown (line 292) | @Override
    method initToolbar (line 302) | @Override
    method initDrawerListView (line 307) | private void initDrawerListView(){
    method initDrawerView (line 325) | private void initDrawerView() {
    method initRecyclerView (line 375) | private void initRecyclerView(){
    method newNote (line 417) | @OnClick(R.id.fab)
    method editNoteType (line 424) | @OnClick(R.id.edit_note_type)
    method onRefresh (line 431) | @Override
    method changeToSelectNoteType (line 436) | private void changeToSelectNoteType(int type){
    method openDrawer (line 442) | private void openDrawer() {
    method closeDrawer (line 448) | private void closeDrawer() {
    method openOrCloseDrawer (line 454) | private void openOrCloseDrawer() {
    method showPopupMenu (line 462) | private void showPopupMenu(View view, final Note note) {
    method showDeleteForeverDialog (line 515) | private void showDeleteForeverDialog(final Note note){
    method startNoteActivity (line 541) | private void startNoteActivity(int oprType, Note value){
    method setMenuListViewGravity (line 550) | private void setMenuListViewGravity(int gravity){
    method initItemData (line 556) | private List<Note> initItemData(int noteType) {
    method showProgressWheel (line 571) | private void showProgressWheel(boolean visible){
    method syncNotes (line 588) | private void syncNotes(final String account){
    method sync (line 683) | private void sync(){
    method onSyncSuccess (line 722) | private void onSyncSuccess(){
    method onSyncFail (line 733) | private void onSyncFail(){
    method changeItemLayout (line 744) | private void changeItemLayout(boolean flow){
    method initItemLayout (line 753) | private void initItemLayout(){

FILE: app/src/main/java/com/lguipeng/notes/ui/NoteActivity.java
  class NoteActivity (line 41) | public class NoteActivity extends BaseActivity{
    method onCreate (line 68) | @Override
    method onDestroy (line 75) | @Override
    method getLayoutView (line 81) | @Override
    method getModules (line 86) | @Override
    method onEventMainThread (line 91) | public void onEventMainThread(Note note) {
    method parseIntent (line 98) | private void parseIntent(Intent intent){
    method initToolbar (line 104) | @Override
    method initEditText (line 123) | private void initEditText(){
    method initTextView (line 146) | private void initTextView(){
    method onCreateOptionsMenu (line 151) | @Override
    method onPrepareOptionsMenu (line 157) | @Override
    method onOptionsItemSelected (line 164) | @Override
    method onKeyDown (line 181) | @Override
    method showNotSaveNoteDialog (line 192) | private void showNotSaveNoteDialog(){
    method saveNote (line 216) | private void saveNote(){
    class SimpleTextWatcher (line 242) | class SimpleTextWatcher implements TextWatcher {
      method beforeTextChanged (line 244) | @Override
      method onTextChanged (line 249) | @Override
      method afterTextChanged (line 268) | @Override
    class SimpleOnFocusChangeListener (line 274) | class SimpleOnFocusChangeListener implements View.OnFocusChangeListener {
      method onFocusChange (line 275) | @Override
    method getOprTimeLineText (line 283) | private String getOprTimeLineText(Note note, boolean all){
    method hideKeyBoard (line 316) | private void hideKeyBoard(EditText editText){

FILE: app/src/main/java/com/lguipeng/notes/ui/PayActivity.java
  class PayActivity (line 17) | public class PayActivity extends BaseActivity{
    method onCreate (line 20) | @Override
    method getLayoutView (line 25) | @Override
    method getModules (line 30) | @Override
    method initToolbar (line 35) | @Override

FILE: app/src/main/java/com/lguipeng/notes/ui/SettingActivity.java
  class SettingActivity (line 18) | public class SettingActivity extends BaseActivity{
    method onCreate (line 22) | @Override
    method getLayoutView (line 28) | @Override
    method getModules (line 33) | @Override
    method initToolbar (line 38) | @Override
    method init (line 44) | private void init(){

FILE: app/src/main/java/com/lguipeng/notes/ui/fragments/BaseFragment.java
  class BaseFragment (line 20) | public abstract class BaseFragment extends PreferenceFragment {
    method onCreate (line 25) | @Override
    method onActivityCreated (line 32) | @Override
    method onDestroy (line 41) | @Override
    method generateDialogBuilder (line 47) | protected AlertDialog.Builder generateDialogBuilder(){
    method getCurrentTheme (line 67) | protected ThemeUtils.Theme getCurrentTheme(){
    method getModules (line 72) | protected abstract List<Object> getModules();

FILE: app/src/main/java/com/lguipeng/notes/ui/fragments/SettingFragment.java
  class SettingFragment (line 39) | public class SettingFragment extends BaseFragment{
    method newInstance (line 65) | public static SettingFragment newInstance(){
    method onCreate (line 70) | @Override
    method onViewCreated (line 93) | @Override
    method SettingFragment (line 101) | public SettingFragment() {
    method onPreferenceTreeClick (line 105) | @Override
    method getModules (line 140) | @Override
    method initFeedbackPreference (line 145) | private void initFeedbackPreference(){
    method initAccountPreference (line 164) | private void initAccountPreference(){
    method showThemeChooseDialog (line 198) | private void showThemeChooseDialog(){
    method showAccountChooseDialog (line 226) | private void showAccountChooseDialog(final CharSequence[] text){
    method giveFavor (line 242) | private void giveFavor(){
    method changeTheme (line 253) | private void changeTheme(ThemeUtils.Theme theme){

FILE: app/src/main/java/com/lguipeng/notes/utils/AccountUtils.java
  class AccountUtils (line 18) | public class AccountUtils {
    method findValidAccount (line 22) | public static void findValidAccount(Context context, AccountFinderList...
    class AccountFinderListener (line 57) | public static abstract class AccountFinderListener{
      method onNone (line 59) | protected abstract void onNone();
      method onOne (line 60) | protected abstract void onOne(String account);
      method onMore (line 61) | protected abstract void onMore(List<String> accountItems);
      method isHasAccountSave (line 63) | public boolean isHasAccountSave() {
      method setHasAccountSave (line 67) | public void setHasAccountSave(boolean hasAccountSave) {

FILE: app/src/main/java/com/lguipeng/notes/utils/JsonUtils.java
  class JsonUtils (line 14) | public class JsonUtils {
    method json (line 16) | public static <T> String json(T note){
    method parse (line 27) | public static <T> T parse(String json, Class<T> clazz){
    method parseNote (line 38) | public static Note parseNote(String json){
    method jsonNote (line 42) | public static String jsonNote(Note note){
    method parseNoteType (line 46) | public static List<String> parseNoteType(String json){
    method jsonNoteType (line 53) | public static String jsonNoteType(NoteType type){

FILE: app/src/main/java/com/lguipeng/notes/utils/NoteConfig.java
  class NoteConfig (line 6) | public class NoteConfig {

FILE: app/src/main/java/com/lguipeng/notes/utils/NotesLog.java
  class NotesLog (line 23) | public class NotesLog{
    method NotesLog (line 29) | private NotesLog(){
    method isDebuggable (line 33) | public static boolean isDebuggable() {
    method createLog (line 37) | private static String createLog( String log ) {
    method getMethodNames (line 50) | private static void getMethodNames(StackTraceElement[] sElements){
    method e (line 56) | public static void e(String message){
    method i (line 65) | public static void i(String message){
    method d (line 73) | public static void d(String message){
    method d (line 81) | public static void d(){
    method v (line 85) | public static void v(String message){
    method w (line 93) | public static void w(String message){
    method wtf (line 101) | public static void wtf(String message){

FILE: app/src/main/java/com/lguipeng/notes/utils/PreferenceUtils.java
  class PreferenceUtils (line 11) | public class PreferenceUtils{
    method PreferenceUtils (line 21) | private PreferenceUtils(Context context){
    method getInstance (line 26) | public static PreferenceUtils getInstance(Context context){
    method getStringParam (line 37) | public String getStringParam(String key){
    method getStringParam (line 41) | public String getStringParam(String key, String defaultString){
    method saveParam (line 45) | public void saveParam(String key, String value)
    method getBooleanParam (line 50) | public boolean getBooleanParam(String key){
    method getBooleanParam (line 54) | public boolean getBooleanParam(String key, boolean defaultBool){
    method saveParam (line 58) | public void saveParam(String key, boolean value){
    method getIntParam (line 62) | public int getIntParam(String key){
    method getIntParam (line 66) | public int getIntParam(String key, int defaultInt){
    method saveParam (line 70) | public void saveParam(String key, int value){
    method getLongParam (line 74) | public long getLongParam(String key){
    method getLongParam (line 78) | public long getLongParam(String key, long defaultInt){
    method saveParam (line 82) | public void saveParam(String key, long value){

FILE: app/src/main/java/com/lguipeng/notes/utils/SnackbarUtils.java
  class SnackbarUtils (line 14) | public class SnackbarUtils {
    method show (line 16) | public static void show(Activity activity, int message) {

FILE: app/src/main/java/com/lguipeng/notes/utils/ThemeUtils.java
  class ThemeUtils (line 10) | public class ThemeUtils {
    method changTheme (line 12) | public static void changTheme(Activity activity, Theme theme){
    type Theme (line 44) | public enum Theme{
      method Theme (line 56) | Theme(int value){
      method mapValueToTheme (line 60) | public static Theme mapValueToTheme(final int value) {
      method getDefault (line 70) | static Theme getDefault()
      method getIntValue (line 74) | public int getIntValue() {

FILE: app/src/main/java/com/lguipeng/notes/utils/TimeUtils.java
  class TimeUtils (line 13) | public class TimeUtils {
    method TimeUtils (line 20) | private TimeUtils() {
    method getTime (line 31) | public static String getTime(long timeInMillis, SimpleDateFormat dateF...
    method getTime (line 41) | public static String getTime(long timeInMillis) {
    method getConciseTime (line 45) | @SuppressWarnings("Deprecated")
    method getConciseTime (line 67) | public static String getConciseTime(long timeInMillis, Context context) {
    method getCurrentTimeInLong (line 75) | public static long getCurrentTimeInLong() {
    method getCurrentTimeInString (line 84) | public static String getCurrentTimeInString() {
    method getCurrentTimeInString (line 93) | public static String getCurrentTimeInString(SimpleDateFormat dateForma...

FILE: app/src/main/java/com/lguipeng/notes/utils/ViewHelper.java
  class ViewHelper (line 9) | public class ViewHelper {
    method clear (line 10) | public static void clear(View v) {

FILE: app/src/main/java/com/lguipeng/notes/utils/WXUtils.java
  class WXUtils (line 19) | public class WXUtils {
    method bmpToByteArray (line 21) | public static byte[] bmpToByteArray(final Bitmap bmp, final boolean ne...
    method getHtmlByteArray (line 38) | public static byte[] getHtmlByteArray(final String url) {
    method inputStreamToByte (line 59) | public static byte[] inputStreamToByte(InputStream is) {
    method readFromFile (line 76) | public static byte[] readFromFile(String fileName, int offset, int len) {
    method extractThumbNail (line 122) | public static Bitmap extractThumbNail(final String path, final int hei...

FILE: app/src/main/java/com/lguipeng/notes/view/FixedRecyclerView.java
  class FixedRecyclerView (line 10) | public class FixedRecyclerView extends RecyclerView {
    method FixedRecyclerView (line 11) | public FixedRecyclerView(Context context) {
    method FixedRecyclerView (line 15) | public FixedRecyclerView(Context context, AttributeSet attrs) {
    method FixedRecyclerView (line 19) | public FixedRecyclerView(Context context, AttributeSet attrs, int defS...
    method canScrollVertically (line 23) | @Override

FILE: orm-library/src/androidTest/java/com/lguipeng/library/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: orm-library/src/main/java/net/tsz/afinal/FinalDb.java
  class FinalDb (line 46) | public class FinalDb{
    method FinalDb (line 55) | private FinalDb(DaoConfig config) {
    method getInstance (line 73) | private synchronized static FinalDb getInstance(DaoConfig daoConfig) {
    method create (line 87) | public static FinalDb create(Context context) {
    method create (line 100) | public static FinalDb create(Context context, boolean isDebug) {
    method create (line 115) | public static FinalDb create(Context context, String dbName) {
    method create (line 131) | public static FinalDb create(Context context, String dbName, boolean i...
    method create (line 146) | public static FinalDb create(Context context, String targetDirectory,
    method create (line 164) | public static FinalDb create(Context context, String targetDirectory,
    method create (line 189) | public static FinalDb create(Context context, String dbName,
    method create (line 216) | public static FinalDb create(Context context, String targetDirectory,
    method create (line 235) | public static FinalDb create(DaoConfig daoConfig) {
    method save (line 244) | public void save(Object entity) {
    method saveBindId (line 258) | public boolean saveBindId(Object entity) {
    method insertContentValues (line 281) | private void insertContentValues(List<KeyValue> list, ContentValues cv) {
    method update (line 298) | public void update(Object entity) {
    method update (line 310) | public void update(Object entity, String strWhere) {
    method delete (line 321) | public void delete(Object entity) {
    method deleteById (line 334) | public void deleteById(Class<?> clazz, Object id) {
    method deleteByWhere (line 346) | public void deleteByWhere(Class<?> clazz, String strWhere) {
    method deleteAll (line 358) | public void deleteAll(Class<?> clazz) {
    method dropTable (line 370) | public void dropTable(Class<?> clazz) {
    method dropDb (line 381) | public void dropDb() {
    method exeSqlInfo (line 395) | private void exeSqlInfo(SqlInfo sqlInfo) {
    method findById (line 410) | public <T> T findById(Object id, Class<T> clazz) {
    method findWithManyToOneById (line 436) | public <T> T findWithManyToOneById(Object id, Class<T> clazz) {
    method findWithManyToOneById (line 457) | public <T> T findWithManyToOneById(Object id, Class<T> clazz,
    method loadManyToOne (line 478) | public <T> T loadManyToOne(DbModel dbModel, T entity, Class<T> clazz,
    method findWithOneToManyById (line 545) | public <T> T findWithOneToManyById(Object id, Class<T> clazz) {
    method findWithOneToManyById (line 565) | public <T> T findWithOneToManyById(Object id, Class<T> clazz,
    method loadOneToMany (line 587) | public <T> T loadOneToMany(T entity, Class<T> clazz, Class<?>... findC...
    method findAll (line 632) | public <T> List<T> findAll(Class<T> clazz) {
    method findAll (line 644) | public <T> List<T> findAll(Class<T> clazz, String orderBy) {
    method findAllByWhere (line 657) | public <T> List<T> findAllByWhere(Class<T> clazz, String strWhere) {
    method findAllByWhere (line 672) | public <T> List<T> findAllByWhere(Class<T> clazz, String strWhere,
    method findAllByWhere (line 677) | public <T> List<T> findAllByWhere(Class<T> clazz, String strWhere,
    method findAllBySql (line 698) | private <T> List<T> findAllBySql(Class<T> clazz, String strSQL) {
    method findDbModelBySQL (line 724) | public DbModel findDbModelBySQL(String strSQL) {
    method findDbModelListBySQL (line 739) | public List<DbModel> findDbModelListBySQL(String strSQL) {
    method checkTableExist (line 755) | private void checkTableExist(Class<?> clazz) {
    method tableIsExist (line 763) | private boolean tableIsExist(TableInfo table) {
    method debugSql (line 792) | private void debugSql(String sql) {
    class DaoConfig (line 797) | public static class DaoConfig {
      method getContext (line 806) | public Context getContext() {
      method setContext (line 810) | public void setContext(Context context) {
      method getDbName (line 814) | public String getDbName() {
      method setDbName (line 818) | public void setDbName(String dbName) {
      method getDbVersion (line 822) | public int getDbVersion() {
      method setDbVersion (line 826) | public void setDbVersion(int dbVersion) {
      method isDebug (line 830) | public boolean isDebug() {
      method setDebug (line 834) | public void setDebug(boolean debug) {
      method getDbUpdateListener (line 838) | public DbUpdateListener getDbUpdateListener() {
      method setDbUpdateListener (line 842) | public void setDbUpdateListener(DbUpdateListener dbUpdateListener) {
      method getTargetDirectory (line 854) | public String getTargetDirectory() {
      method setTargetDirectory (line 858) | public void setTargetDirectory(String targetDirectory) {
    method createDbFileOnSDCard (line 870) | private SQLiteDatabase createDbFileOnSDCard(String sdcardPath,
    class SqliteDbHelper (line 888) | class SqliteDbHelper extends SQLiteOpenHelper {
      method SqliteDbHelper (line 892) | public SqliteDbHelper(Context context, String name, int version,
      method onCreate (line 898) | @Override
      method onUpgrade (line 902) | @Override
    type DbUpdateListener (line 913) | public interface DbUpdateListener {
      method onUpgrade (line 914) | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVers...

FILE: orm-library/src/main/java/net/tsz/afinal/core/AbstractCollection.java
  class AbstractCollection (line 32) | public abstract class AbstractCollection<E> implements Collection<E> {
    method AbstractCollection (line 37) | protected AbstractCollection() {
    method add (line 40) | public boolean add(E object) {
    method addAll (line 73) | public boolean addAll(Collection<? extends E> collection) {
    method clear (line 100) | public void clear() {
    method contains (line 127) | public boolean contains(Object object) {
    method containsAll (line 165) | public boolean containsAll(Collection<?> collection) {
    method isEmpty (line 184) | public boolean isEmpty() {
    method iterator (line 199) | public abstract Iterator<E> iterator();
    method remove (line 225) | public boolean remove(Object object) {
    method removeAll (line 274) | public boolean removeAll(Collection<?> collection) {
    method retainAll (line 315) | public boolean retainAll(Collection<?> collection) {
    method size (line 337) | public abstract int size();
    method toArray (line 339) | public Object[] toArray() {
    method toArray (line 349) | @SuppressWarnings("unchecked")
    method toString (line 372) | @Override

FILE: orm-library/src/main/java/net/tsz/afinal/core/ArrayDeque.java
  class ArrayDeque (line 59) | public class ArrayDeque<E> extends AbstractCollection<E> implements Dequ...
    method allocateElements (line 99) | @SuppressWarnings("unchecked")
    method doubleCapacity (line 123) | @SuppressWarnings("unchecked")
    method copyElements (line 147) | private <T> T[] copyElements(T[] a) {
    method ArrayDeque (line 162) | @SuppressWarnings("unchecked")
    method ArrayDeque (line 173) | public ArrayDeque(int numElements) {
    method ArrayDeque (line 187) | public ArrayDeque(Collection<? extends E> c) {
    method addFirst (line 202) | public void addFirst(E e) {
    method addLast (line 218) | public void addLast(E e) {
    method offerFirst (line 233) | public boolean offerFirst(E e) {
    method offerLast (line 245) | public boolean offerLast(E e) {
    method removeFirst (line 253) | public E removeFirst() {
    method removeLast (line 263) | public E removeLast() {
    method pollFirst (line 270) | public E pollFirst() {
    method pollLast (line 280) | public E pollLast() {
    method getFirst (line 293) | public E getFirst() {
    method getLast (line 303) | public E getLast() {
    method peekFirst (line 310) | public E peekFirst() {
    method peekLast (line 314) | public E peekLast() {
    method removeFirstOccurrence (line 330) | public boolean removeFirstOccurrence(Object o) {
    method removeLastOccurrence (line 358) | public boolean removeLastOccurrence(Object o) {
    method add (line 385) | public boolean add(E e) {
    method offer (line 399) | public boolean offer(E e) {
    method remove (line 414) | public E remove() {
    method poll (line 428) | public E poll() {
    method element (line 442) | public E element() {
    method peek (line 455) | public E peek() {
    method push (line 470) | public void push(E e) {
    method pop (line 484) | public E pop() {
    method checkInvariants (line 488) | private void checkInvariants() {
    method delete (line 506) | private boolean delete(int i) {
    method size (line 552) | public int size() {
    method isEmpty (line 561) | public boolean isEmpty() {
    method iterator (line 573) | public Iterator<E> iterator() {
    method descendingIterator (line 577) | public Iterator<E> descendingIterator() {
    class DeqIterator (line 581) | private class DeqIterator implements Iterator<E> {
      method hasNext (line 599) | public boolean hasNext() {
      method next (line 603) | public E next() {
      method remove (line 616) | public void remove() {
    class DescendingIterator (line 627) | private class DescendingIterator implements Iterator<E> {
      method hasNext (line 637) | public boolean hasNext() {
      method next (line 641) | public E next() {
      method remove (line 652) | public void remove() {
    method contains (line 671) | public boolean contains(Object o) {
    method remove (line 698) | public boolean remove(Object o) {
    method clear (line 706) | public void clear() {
    method toArray (line 733) | public Object[] toArray() {
    method toArray (line 774) | @SuppressWarnings("unchecked")
    method clone (line 793) | public ArrayDeque<E> clone() {
    method writeObject (line 817) | private void writeObject(ObjectOutputStream s) throws IOException {
    method readObject (line 832) | @SuppressWarnings("unchecked")

FILE: orm-library/src/main/java/net/tsz/afinal/core/Arrays.java
  class Arrays (line 32) | public class Arrays {
    class ArrayList (line 33) | private static class ArrayList<E> extends AbstractList<E> implements
      method ArrayList (line 40) | ArrayList(E[] storage) {
      method contains (line 47) | @Override
      method get (line 65) | @Override
      method indexOf (line 75) | @Override
      method lastIndexOf (line 93) | @Override
      method set (line 111) | @Override
      method size (line 118) | @Override
      method toArray (line 123) | @Override
      method toArray (line 128) | @SuppressWarnings("unchecked")
    method Arrays (line 144) | private Arrays() {
    method asList (line 158) | public static <T> List<T> asList(T... array) {
    method binarySearch (line 172) | public static int binarySearch(byte[] array, byte value) {
    method binarySearch (line 192) | public static int binarySearch(byte[] array, int startIndex, int endIn...
    method binarySearch (line 222) | public static int binarySearch(char[] array, char value) {
    method binarySearch (line 242) | public static int binarySearch(char[] array, int startIndex, int endIn...
    method binarySearch (line 272) | public static int binarySearch(double[] array, double value) {
    method binarySearch (line 292) | public static int binarySearch(double[] array, int startIndex, int end...
    method binarySearch (line 333) | public static int binarySearch(float[] array, float value) {
    method binarySearch (line 353) | public static int binarySearch(float[] array, int startIndex, int endI...
    method binarySearch (line 394) | public static int binarySearch(int[] array, int value) {
    method binarySearch (line 414) | public static int binarySearch(int[] array, int startIndex, int endInd...
    method binarySearch (line 444) | public static int binarySearch(long[] array, long value) {
    method binarySearch (line 464) | public static int binarySearch(long[] array, int startIndex, int endIn...
    method binarySearch (line 497) | public static int binarySearch(Object[] array, Object value) {
    method binarySearch (line 520) | @SuppressWarnings("unchecked")
    method binarySearch (line 557) | public static <T> int binarySearch(T[] array, T value, Comparator<? su...
    method binarySearch (line 582) | public static <T> int binarySearch(T[] array, int startIndex, int endI...
    method binarySearch (line 617) | public static int binarySearch(short[] array, short value) {
    method binarySearch (line 637) | public static int binarySearch(short[] array, int startIndex, int endI...
    method checkBinarySearchBounds (line 657) | private static void checkBinarySearchBounds(int startIndex, int endInd...
    method fill (line 674) | public static void fill(byte[] array, byte value) {
    method fill (line 690) | public static void fill(int[] array, int value) {
    method fill (line 706) | public static void fill(boolean[] array, boolean value) {
    method fill (line 722) | public static void fill(Object[] array, Object value) {
    method hashCode (line 746) | public static int hashCode(boolean[] array) {
    method hashCode (line 774) | public static int hashCode(int[] array) {
    method hashCode (line 802) | public static int hashCode(short[] array) {
    method hashCode (line 830) | public static int hashCode(char[] array) {
    method hashCode (line 858) | public static int hashCode(byte[] array) {
    method hashCode (line 886) | public static int hashCode(long[] array) {
    method hashCode (line 918) | public static int hashCode(float[] array) {
    method hashCode (line 949) | public static int hashCode(double[] array) {
    method hashCode (line 986) | public static int hashCode(Object[] array) {
    method deepHashCode (line 1031) | public static int deepHashCode(Object[] array) {
    method deepHashCodeElement (line 1043) | private static int deepHashCodeElement(Object element) {
    method equals (line 1096) | public static boolean equals(byte[] array1, byte[] array2) {
    method equals (line 1122) | public static boolean equals(short[] array1, short[] array2) {
    method equals (line 1148) | public static boolean equals(char[] array1, char[] array2) {
    method equals (line 1174) | public static boolean equals(int[] array1, int[] array2) {
    method equals (line 1200) | public static boolean equals(long[] array1, long[] array2) {
    method equals (line 1228) | public static boolean equals(float[] array1, float[] array2) {
    method equals (line 1257) | public static boolean equals(double[] array1, double[] array2) {
    method equals (line 1284) | public static boolean equals(boolean[] array1, boolean[] array2) {
    method equals (line 1310) | public static boolean equals(Object[] array1, Object[] array2) {
    method deepEquals (line 1362) | public static boolean deepEquals(Object[] array1, Object[] array2) {
    method deepEqualsElements (line 1379) | private static boolean deepEqualsElements(Object e1, Object e2) {
    method toString (line 1462) | public static String toString(boolean[] array) {
    method toString (line 1492) | public static String toString(byte[] array) {
    method toString (line 1522) | public static String toString(char[] array) {
    method toString (line 1552) | public static String toString(double[] array) {
    method toString (line 1582) | public static String toString(float[] array) {
    method toString (line 1612) | public static String toString(int[] array) {
    method toString (line 1642) | public static String toString(long[] array) {
    method toString (line 1672) | public static String toString(short[] array) {
    method toString (line 1702) | public static String toString(Object[] array) {
    method deepToString (line 1737) | public static String deepToString(Object[] array) {
    method deepToStringImpl (line 1762) | private static void deepToStringImpl(Object[] array, Object[] origArrays,
    method deepToStringImplContains (line 1844) | private static boolean deepToStringImplContains(Object[] origArrays,
    method copyOf (line 1869) | public static boolean[] copyOf(boolean[] original, int newLength) {
    method copyOf (line 1888) | public static byte[] copyOf(byte[] original, int newLength) {
    method copyOf (line 1907) | public static char[] copyOf(char[] original, int newLength) {
    method copyOf (line 1926) | public static double[] copyOf(double[] original, int newLength) {
    method copyOf (line 1945) | public static float[] copyOf(float[] original, int newLength) {
    method copyOf (line 1964) | public static int[] copyOf(int[] original, int newLength) {
    method copyOf (line 1983) | public static long[] copyOf(long[] original, int newLength) {
    method copyOf (line 2002) | public static short[] copyOf(short[] original, int newLength) {
    method copyOf (line 2021) | public static <T> T[] copyOf(T[] original, int newLength) {
    method copyOf (line 2045) | public static <T, U> T[] copyOf(U[] original, int newLength, Class<? e...
    method copyOfRange (line 2068) | public static boolean[] copyOfRange(boolean[] original, int start, int...
    method copyOfRange (line 2098) | public static byte[] copyOfRange(byte[] original, int start, int end) {
    method copyOfRange (line 2128) | public static char[] copyOfRange(char[] original, int start, int end) {
    method copyOfRange (line 2158) | public static double[] copyOfRange(double[] original, int start, int e...
    method copyOfRange (line 2188) | public static float[] copyOfRange(float[] original, int start, int end) {
    method copyOfRange (line 2218) | public static int[] copyOfRange(int[] original, int start, int end) {
    method copyOfRange (line 2248) | public static long[] copyOfRange(long[] original, int start, int end) {
    method copyOfRange (line 2278) | public static short[] copyOfRange(short[] original, int start, int end) {
    method copyOfRange (line 2308) | @SuppressWarnings("unchecked")
    method copyOfRange (line 2340) | @SuppressWarnings("unchecked")

FILE: orm-library/src/main/java/net/tsz/afinal/core/AsyncTask.java
  class AsyncTask (line 32) | public abstract class AsyncTask<Params, Progress, Result> {
    method newThread (line 41) | public Thread newThread(Runnable r) {
    class SerialExecutor (line 80) | private static class SerialExecutor implements Executor {
      method execute (line 84) | public synchronized void execute(final Runnable r) {
      method scheduleNext (line 99) | protected synchronized void scheduleNext() {
    type Status (line 110) | public enum Status {
    method init (line 126) | public static void init() {
    method setDefaultExecutor (line 131) | public static void setDefaultExecutor(Executor exec) {
    method AsyncTask (line 138) | public AsyncTask() {
    method postResultIfNotInvoked (line 166) | private void postResultIfNotInvoked(Result result) {
    method postResult (line 173) | private Result postResult(Result result) {
    method getStatus (line 186) | public final Status getStatus() {
    method doInBackground (line 206) | protected abstract Result doInBackground(Params... params);
    method onPreExecute (line 214) | protected void onPreExecute() {
    method onPostExecute (line 229) | protected void onPostExecute(Result result) {
    method onProgressUpdate (line 241) | protected void onProgressUpdate(Progress... values) {
    method onCancelled (line 258) | protected void onCancelled(Result result) {
    method onCancelled (line 274) | protected void onCancelled() {
    method isCancelled (line 287) | public final boolean isCancelled() {
    method cancel (line 320) | public final boolean cancel(boolean mayInterruptIfRunning) {
    method get (line 336) | public final Result get() throws InterruptedException, ExecutionExcept...
    method get (line 355) | public final Result get(long timeout, TimeUnit unit) throws Interrupte...
    method execute (line 388) | public final AsyncTask<Params, Progress, Result> execute(Params... par...
    method executeOnExecutor (line 425) | @SuppressWarnings("incomplete-switch")
    method execute (line 458) | public static void execute(Runnable runnable) {
    method publishProgress (line 476) | protected final void publishProgress(Progress... values) {
    method finish (line 483) | private void finish(Result result) {
    class InternalHandler (line 492) | private static class InternalHandler extends Handler {
      method handleMessage (line 493) | @SuppressWarnings("unchecked")
    class WorkerRunnable (line 509) | private static abstract class WorkerRunnable<Params, Result> implement...
    class AsyncTaskResult (line 513) | private static class AsyncTaskResult<Data> {
      method AsyncTaskResult (line 518) | AsyncTaskResult(@SuppressWarnings("rawtypes") AsyncTask task, Data.....

FILE: orm-library/src/main/java/net/tsz/afinal/core/Deque.java
  type Deque (line 168) | public interface Deque<E> extends Queue<E> {
    method addFirst (line 185) | void addFirst(E e);
    method addLast (line 205) | void addLast(E e);
    method offerFirst (line 223) | boolean offerFirst(E e);
    method offerLast (line 241) | boolean offerLast(E e);
    method removeFirst (line 251) | E removeFirst();
    method removeLast (line 261) | E removeLast();
    method pollFirst (line 269) | E pollFirst();
    method pollLast (line 277) | E pollLast();
    method getFirst (line 288) | E getFirst();
    method getLast (line 298) | E getLast();
    method peekFirst (line 306) | E peekFirst();
    method peekLast (line 314) | E peekLast();
    method removeFirstOccurrence (line 332) | boolean removeFirstOccurrence(Object o);
    method removeLastOccurrence (line 350) | boolean removeLastOccurrence(Object o);
    method add (line 376) | boolean add(E e);
    method offer (line 399) | boolean offer(E e);
    method remove (line 412) | E remove();
    method poll (line 424) | E poll();
    method element (line 437) | E element();
    method peek (line 449) | E peek();
    method push (line 473) | void push(E e);
    method pop (line 485) | E pop();
    method remove (line 508) | boolean remove(Object o);
    method contains (line 523) | boolean contains(Object o);
    method size (line 530) | public int size();
    method iterator (line 538) | Iterator<E> iterator();
    method descendingIterator (line 548) | Iterator<E> descendingIterator();

FILE: orm-library/src/main/java/net/tsz/afinal/core/FileNameGenerator.java
  class FileNameGenerator (line 21) | public class FileNameGenerator {
    method generator (line 24) | public static String generator(String key) {
    method bytesToHexString (line 36) | private static String bytesToHexString(byte[] bytes) {

FILE: orm-library/src/main/java/net/tsz/afinal/core/Queue.java
  type Queue (line 116) | public interface Queue<E> extends Collection<E> {
    method add (line 134) | boolean add(E e);
    method offer (line 153) | boolean offer(E e);
    method remove (line 163) | E remove();
    method poll (line 171) | E poll();
    method element (line 181) | E element();
    method peek (line 189) | E peek();

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/CursorUtils.java
  class CursorUtils (line 30) | public class CursorUtils {
    method getEntity (line 32) | public static <T> T getEntity(Cursor cursor, Class<T> clazz,FinalDb db){
    method getDbModel (line 84) | public static DbModel getDbModel(Cursor cursor){
    method dbModel2Entity (line 97) | public static <T> T dbModel2Entity(DbModel dbModel,Class<?> clazz){

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/DbModel.java
  class DbModel (line 20) | public class DbModel {
    method get (line 24) | public Object get(String column){
    method getString (line 28) | public String getString(String column){
    method getInt (line 32) | public int getInt(String column){
    method getBoolean (line 36) | public boolean getBoolean(String column){
    method getDouble (line 40) | public double getDouble(String column){
    method getFloat (line 44) | public float getFloat(String column){
    method getLong (line 48) | public long getLong(String column){
    method set (line 52) | public void set(String key,Object value){
    method getDataMap (line 56) | public HashMap<String, Object> getDataMap(){

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/ManyToOneLazyLoader.java
  class ManyToOneLazyLoader (line 12) | public class ManyToOneLazyLoader<M,O> {
    method ManyToOneLazyLoader (line 21) | public ManyToOneLazyLoader(M manyEntity, Class<M> manyClazz, Class<O> ...
    method get (line 34) | public O get(){
    method set (line 41) | public void set(O value){
    method getFieldValue (line 45) | public Object getFieldValue() {
    method setFieldValue (line 49) | public void setFieldValue(Object fieldValue) {

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/OneToManyLazyLoader.java
  class OneToManyLazyLoader (line 15) | public class OneToManyLazyLoader<O,M> {
    method OneToManyLazyLoader (line 20) | public OneToManyLazyLoader(O ownerEntity,Class<O> ownerClazz,Class<M> ...
    method getList (line 32) | public List<M> getList(){
    method setList (line 41) | public void setList(List<M> value){

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/SqlBuilder.java
  class SqlBuilder (line 31) | public class SqlBuilder {
    method buildInsertSql (line 37) | public static SqlInfo buildInsertSql(Object entity){
    method getSaveKeyValueListByEntity (line 70) | public static List<KeyValue> getSaveKeyValueListByEntity(Object entity){
    method getDeleteSqlBytableName (line 103) | private static String getDeleteSqlBytableName(String tableName){
    method buildDeleteSql (line 108) | public static SqlInfo buildDeleteSql(Object entity){
    method buildDeleteSql (line 129) | public static SqlInfo buildDeleteSql(Class<?> clazz , Object idValue){
    method buildDeleteSql (line 153) | public static String buildDeleteSql(Class<?> clazz , String strWhere){
    method getSelectSqlByTableName (line 169) | private static String getSelectSqlByTableName(String tableName){
    method getSelectSQL (line 174) | public static String getSelectSQL(Class<?> clazz,Object idValue){
    method getSelectSqlAsSqlInfo (line 184) | public static SqlInfo getSelectSqlAsSqlInfo(Class<?> clazz,Object idVa...
    method getSelectSQL (line 198) | public static String getSelectSQL(Class<?> clazz){
    method getSelectSQLByWhere (line 202) | public static String getSelectSQLByWhere(Class<?> clazz,String strWhere){
    method getUpdateSqlAsSqlInfo (line 216) | public static SqlInfo getUpdateSqlAsSqlInfo(Object entity){
    method getUpdateSqlAsSqlInfo (line 261) | public static SqlInfo getUpdateSqlAsSqlInfo(Object entity,String  strW...
    method getCreatTableSQL (line 303) | public static String getCreatTableSQL(Class<?> clazz){
    method getPropertyStrSql (line 355) | private static String getPropertyStrSql(String key,Object value){
    method property2KeyValue (line 367) | private static KeyValue property2KeyValue(Property property , Object e...
    method manyToOne2KeyValue (line 381) | private static KeyValue manyToOne2KeyValue(ManyToOne many , Object ent...

FILE: orm-library/src/main/java/net/tsz/afinal/db/sqlite/SqlInfo.java
  class SqlInfo (line 5) | public class SqlInfo {
    method getSql (line 10) | public String getSql() {
    method setSql (line 13) | public void setSql(String sql) {
    method getBindArgs (line 17) | public LinkedList<Object> getBindArgs() {
    method setBindArgs (line 20) | public void setBindArgs(LinkedList<Object> bindArgs) {
    method getBindArgsAsArray (line 24) | public Object[] getBindArgsAsArray() {
    method getBindArgsAsStringArray (line 30) | public String[] getBindArgsAsStringArray() {
    method addValue (line 41) | public void addValue(Object obj){

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/Id.java
  class Id (line 18) | public class Id extends Property{

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/KeyValue.java
  class KeyValue (line 20) | public class KeyValue {
    method KeyValue (line 24) | public KeyValue(String key, Object value) {
    method KeyValue (line 30) | public KeyValue() {}
    method getKey (line 33) | public String getKey() {
    method setKey (line 36) | public void setKey(String key) {
    method getValue (line 39) | public Object getValue() {
    method setValue (line 45) | public void setValue(Object value) {

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/ManyToOne.java
  class ManyToOne (line 18) | public class ManyToOne extends Property{
    method getManyClass (line 22) | public Class<?> getManyClass() {
    method setManyClass (line 26) | public void setManyClass(Class<?> manyClass) {

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/OneToMany.java
  class OneToMany (line 18) | public class OneToMany extends Property{
    method getOneClass (line 22) | public Class<?> getOneClass() {
    method setOneClass (line 26) | public void setOneClass(Class<?> oneClass) {

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/Property.java
  class Property (line 31) | public class Property {
    method setValue (line 42) | public void setValue(Object receiver , Object value){
    method getValue (line 81) | @SuppressWarnings("unchecked")
    method getFieldName (line 94) | public String getFieldName() {
    method setFieldName (line 97) | public void setFieldName(String fieldName) {
    method getColumn (line 100) | public String getColumn() {
    method setColumn (line 103) | public void setColumn(String column) {
    method getDefaultValue (line 106) | public String getDefaultValue() {
    method setDefaultValue (line 109) | public void setDefaultValue(String defaultValue) {
    method getDataType (line 112) | public Class<?> getDataType() {
    method setDataType (line 115) | public void setDataType(Class<?> dataType) {
    method getGet (line 118) | public Method getGet() {
    method setGet (line 121) | public void setGet(Method get) {
    method getSet (line 124) | public Method getSet() {
    method setSet (line 127) | public void setSet(Method set) {
    method getField (line 131) | public Field getField() {
    method setField (line 135) | public void setField(Field field) {

FILE: orm-library/src/main/java/net/tsz/afinal/db/table/TableInfo.java
  class TableInfo (line 27) | public class TableInfo {
    method TableInfo (line 43) | private TableInfo(){}
    method get (line 45) | @SuppressWarnings("unused")
    method get (line 106) | public static TableInfo get(String className){
    method getClassName (line 116) | public String getClassName() {
    method setClassName (line 120) | public void setClassName(String className) {
    method getTableName (line 124) | public String getTableName() {
    method setTableName (line 128) | public void setTableName(String tableName) {
    method getId (line 132) | public Id getId() {
    method setId (line 136) | public void setId(Id id) {
    method isCheckDatabese (line 140) | public boolean isCheckDatabese() {
    method setCheckDatabese (line 144) | public void setCheckDatabese(boolean checkDatabese) {

FILE: orm-library/src/main/java/net/tsz/afinal/exception/AfinalException.java
  class AfinalException (line 18) | public class AfinalException extends RuntimeException {
    method AfinalException (line 21) | public AfinalException() {
    method AfinalException (line 25) | public AfinalException(String msg) {
    method AfinalException (line 29) | public AfinalException(Throwable ex) {
    method AfinalException (line 33) | public AfinalException(String msg,Throwable ex) {

FILE: orm-library/src/main/java/net/tsz/afinal/exception/DbException.java
  class DbException (line 18) | public class DbException extends AfinalException {
    method DbException (line 21) | public DbException() {}
    method DbException (line 24) | public DbException(String msg) {
    method DbException (line 28) | public DbException(Throwable ex) {
    method DbException (line 32) | public DbException(String msg,Throwable ex) {

FILE: orm-library/src/main/java/net/tsz/afinal/utils/ClassUtils.java
  class ClassUtils (line 32) | public class ClassUtils {
    method getTableName (line 40) | public static String getTableName(Class<?> clazz) {
    method getPrimaryKeyValue (line 49) | public static Object getPrimaryKeyValue(Object entity) {
    method getPrimaryKeyColumn (line 58) | public static String getPrimaryKeyColumn(Class<?> clazz) {
    method getPrimaryKeyField (line 100) | public static Field getPrimaryKeyField(Class<?> clazz) {
    method getPrimaryKeyFieldName (line 142) | public static String getPrimaryKeyFieldName(Class<?> clazz) {
    method getPropertyList (line 156) | public static List<Property> getPropertyList(Class<?> clazz) {
    method getManyToOneList (line 198) | public static List<ManyToOne> getManyToOneList(Class<?> clazz) {
    method getOneToManyList (line 238) | public static List<OneToMany> getOneToManyList(Class<?> clazz) {

FILE: orm-library/src/main/java/net/tsz/afinal/utils/FieldUtils.java
  class FieldUtils (line 39) | public class FieldUtils {
    method getFieldGetMethod (line 42) | public static Method getFieldGetMethod(Class<?> clazz, Field f) {
    method getBooleanFieldGetMethod (line 54) | public static Method getBooleanFieldGetMethod(Class<?> clazz, String f...
    method getBooleanFieldSetMethod (line 68) | public static Method getBooleanFieldSetMethod(Class<?> clazz, Field f) {
    method isISStart (line 83) | private static boolean isISStart(String fieldName){
    method getFieldGetMethod (line 93) | public static Method getFieldGetMethod(Class<?> clazz, String fieldNam...
    method getFieldSetMethod (line 103) | public static Method getFieldSetMethod(Class<?> clazz, Field f) {
    method getFieldSetMethod (line 116) | public static Method getFieldSetMethod(Class<?> clazz, String fieldNam...
    method getFieldValue (line 133) | public static Object getFieldValue(Object entity,Field field){
    method getFieldValue (line 144) | public static Object getFieldValue(Object entity,String fieldName){
    method setFieldValue (line 155) | public static void setFieldValue(Object entity,Field field,Object value){
    method getFieldByColumnName (line 187) | public static Field getFieldByColumnName(Class<?> clazz,String columnN...
    method getFieldByName (line 226) | public static Field getFieldByName(Class<?> clazz,String fieldName){
    method getColumnByField (line 248) | public static String getColumnByField(Field field){
    method getPropertyDefaultValue (line 273) | public static String getPropertyDefaultValue(Field field){
    method isTransient (line 288) | public static boolean isTransient(Field f) {
    method invoke (line 298) | private static Object invoke(Object obj , Method method){
    method isManyToOne (line 313) | public static boolean isManyToOne(Field field){
    method isOneToMany (line 317) | public static boolean isOneToMany(Field field){
    method isManyToOneOrOneToMany (line 321) | public static boolean isManyToOneOrOneToMany(Field field){
    method isBaseDateType (line 325) | public static boolean isBaseDateType(Field field){
    method stringToDateTime (line 342) | public static Date stringToDateTime(String strDate) {

FILE: orm-library/src/main/java/net/tsz/afinal/utils/Utils.java
  class Utils (line 26) | public class Utils {
    method getDiskCacheDir (line 39) | public static File getDiskCacheDir(Context context, String uniqueName) {
    method getBitmapSize (line 53) | public static int getBitmapSize(Bitmap bitmap) {
    method getExternalCacheDir (line 63) | public static File getExternalCacheDir(Context context) {
    method getUsableSpace (line 73) | public static long getUsableSpace(File path) {
    method getBytes (line 86) | public static byte[] getBytes(String in) {
    method isSameKey (line 96) | public static boolean isSameKey(byte[] key, byte[] buffer) {
    method copyOfRange (line 109) | public static byte[] copyOfRange(byte[] original, int from, int to) {
    method makeKey (line 133) | public static byte[] makeKey(String httpUrl) {
    method crc64Long (line 143) | public static final long crc64Long(String in) {
    method crc64Long (line 150) | public static final long crc64Long(byte[] buffer) {
Condensed preview — 157 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (556K chars).
[
  {
    "path": ".gitignore",
    "chars": 91,
    "preview": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": ".idea/.name",
    "chars": 5,
    "preview": "Notes"
  },
  {
    "path": ".idea/compiler.xml",
    "chars": 709,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <option name"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "chars": 74,
    "preview": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "chars": 159,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" chars"
  },
  {
    "path": ".idea/gradle.xml",
    "chars": 729,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linke"
  },
  {
    "path": ".idea/misc.xml",
    "chars": 2629,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points v"
  },
  {
    "path": ".idea/modules.xml",
    "chars": 633,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n   "
  },
  {
    "path": ".idea/vcs.xml",
    "chars": 180,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping dire"
  },
  {
    "path": "MaterialPreference/MaterialPreference.iml",
    "chars": 7903,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":MaterialPreference\" external.linked.project."
  },
  {
    "path": "MaterialPreference/build.gradle",
    "chars": 550,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n  compileSdkVersion Integer.parseInt(ANDROID_BUILD_COMPILE_SDK_VERSION)\n "
  },
  {
    "path": "MaterialPreference/src/main/AndroidManifest.xml",
    "chars": 50,
    "preview": "<manifest package=\"com.jenzz.materialpreference\"/>"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/CheckBoxPreference.java",
    "chars": 1905,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport and"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/Preference.java",
    "chars": 3640,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport andro"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceCategory.java",
    "chars": 2037,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport andro"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/PreferenceImageView.java",
    "chars": 2314,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport andro"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/SwitchPreference.java",
    "chars": 1687,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport and"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/ThemeUtils.java",
    "chars": 1217,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport andro"
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/TwoStatePreference.java",
    "chars": 6917,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport "
  },
  {
    "path": "MaterialPreference/src/main/java/com/jenzz/materialpreference/Typefaces.java",
    "chars": 1075,
    "preview": "package com.jenzz.materialpreference;\n\nimport android.content.Context;\nimport android.graphics.Typeface;\nimport android."
  },
  {
    "path": "MaterialPreference/src/main/res/layout/mp_checkbox_preference.xml",
    "chars": 286,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CheckBox xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:"
  },
  {
    "path": "MaterialPreference/src/main/res/layout/mp_preference.xml",
    "chars": 2945,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.balysv.materialripple.MaterialRippleLayout\n    xmlns:android=\"http://schemas"
  },
  {
    "path": "MaterialPreference/src/main/res/layout/mp_preference_category.xml",
    "chars": 383,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:"
  },
  {
    "path": "MaterialPreference/src/main/res/layout/mp_switch_preference.xml",
    "chars": 352,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.SwitchCompat xmlns:android=\"http://schemas.android.com"
  },
  {
    "path": "MaterialPreference/src/main/res/values/mp_attrs.xml",
    "chars": 128,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n  <attr name=\"mp_colorAccent\"\n      format=\"reference|color\"/>\n\n</re"
  },
  {
    "path": "Notes.iml",
    "chars": 936,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\"Notes\" external.linked.project.path=\"$MODULE_"
  },
  {
    "path": "README.md",
    "chars": 1504,
    "preview": "#ScreenShot\n<img src=\"./screenshot/S50603-103314.jpg\" width=\"30%\" height=\"30%\">\n<img src=\"./screenshot/S50605-164248.jpg"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/app.iml",
    "chars": 9947,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_D"
  },
  {
    "path": "app/build.gradle",
    "chars": 4702,
    "preview": "apply plugin: 'com.android.application'\ndef packTime() {\n    return new Date().format(\"yyyyMMddHHmm\", TimeZone.getTimeZo"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 668,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in E:"
  },
  {
    "path": "app/src/androidTest/java/com/lguipeng/notes/ApplicationTest.java",
    "chars": 349,
    "preview": "package com.lguipeng.notes;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"h"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 2430,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"com.lguipeng.notes\">\n    <uses-permission "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/App.java",
    "chars": 934,
    "preview": "package com.lguipeng.notes;\n\nimport android.app.Application;\n\nimport com.lguipeng.notes.module.AppModule;\n\nimport java.u"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/BaseListAdapter.java",
    "chars": 3418,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport andr"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/BaseRecyclerViewAdapter.java",
    "chars": 4983,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.animation.Animator;\nimport android.content.Context;\nimport android.s"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/ColorsListAdapter.java",
    "chars": 1517,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android."
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/DrawerListAdapter.java",
    "chars": 432,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.content.Context;\n\nimport com.lguipeng.notes.R;\n\nimport java.util.Lis"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/MaterialSimpleListAdapter.java",
    "chars": 1151,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.content.Context;\nimport android.view.View;\nimport android.view.ViewG"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/NotesAdapter.java",
    "chars": 4508,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/NotesItemViewHolder.java",
    "chars": 1701,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.text.TextUtils;\nimpor"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/adpater/SimpleListAdapter.java",
    "chars": 1125,
    "preview": "package com.lguipeng.notes.adpater;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android."
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/listener/bmob/FindListenerImpl.java",
    "chars": 403,
    "preview": "package com.lguipeng.notes.listener.bmob;\n\nimport com.lguipeng.notes.utils.NotesLog;\n\nimport java.util.List;\n\nimport cn."
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/listener/bmob/SaveListenerImpl.java",
    "chars": 363,
    "preview": "package com.lguipeng.notes.listener.bmob;\n\nimport com.lguipeng.notes.utils.NotesLog;\n\nimport cn.bmob.v3.listener.SaveLis"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/listener/bmob/UpdateListenerImpl.java",
    "chars": 370,
    "preview": "package com.lguipeng.notes.listener.bmob;\n\nimport com.lguipeng.notes.utils.NotesLog;\n\nimport cn.bmob.v3.listener.UpdateL"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/listener/view/RecyclerViewClickListener.java",
    "chars": 542,
    "preview": "package com.lguipeng.notes.listener.view;\n\nimport android.view.View;\n\n/**\n * Interface definition for a callback to be i"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/model/CloudNote.java",
    "chars": 1585,
    "preview": "package com.lguipeng.notes.model;\n\nimport com.lguipeng.notes.utils.JsonUtils;\n\nimport java.util.ArrayList;\nimport java.u"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/model/MaterialSimpleListItem.java",
    "chars": 1684,
    "preview": "package com.lguipeng.notes.model;\n\nimport android.content.Context;\nimport android.graphics.drawable.Drawable;\nimport and"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/model/Note.java",
    "chars": 1726,
    "preview": "package com.lguipeng.notes.model;\n\nimport com.alibaba.fastjson.annotation.JSONField;\nimport com.lguipeng.notes.utils.Jso"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/model/NoteOperateLog.java",
    "chars": 900,
    "preview": "package com.lguipeng.notes.model;\n\nimport net.tsz.afinal.annotation.sqlite.ManyToOne;\nimport net.tsz.afinal.annotation.s"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/model/NoteType.java",
    "chars": 870,
    "preview": "package com.lguipeng.notes.model;\n\nimport android.text.TextUtils;\n\nimport com.alibaba.fastjson.annotation.JSONField;\n\nim"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/module/AppModule.java",
    "chars": 598,
    "preview": "package com.lguipeng.notes.module;\n\nimport android.app.Application;\nimport android.content.Context;\n\nimport com.lguipeng"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/module/DataModule.java",
    "chars": 1374,
    "preview": "package com.lguipeng.notes.module;\n\nimport android.content.Context;\n\nimport com.lguipeng.notes.ui.AboutActivity;\nimport "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/AboutActivity.java",
    "chars": 9368,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.content.ActivityNotFoundException;\nimport android.content.Context;\nimport"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/BaseActivity.java",
    "chars": 5066,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.annotation.TargetApi;\nimport android.os.Build;\nimport android.os.Bundle;\n"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/EditNoteTypeActivity.java",
    "chars": 4584,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.support.v7.widg"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/MainActivity.java",
    "chars": 28170,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.app.SearchManager;\nimport android.content.ComponentName;\nimport android.c"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/NoteActivity.java",
    "chars": 10568,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.c"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/PayActivity.java",
    "chars": 869,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.os.Bundle;\nimport android.support.v7.widget.Toolbar;\n\nimport com.lguipeng"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/SettingActivity.java",
    "chars": 1160,
    "preview": "package com.lguipeng.notes.ui;\n\nimport android.os.Bundle;\nimport android.support.v7.widget.Toolbar;\n\nimport com.lguipeng"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/fragments/BaseFragment.java",
    "chars": 2374,
    "preview": "package com.lguipeng.notes.ui.fragments;\n\nimport android.os.Bundle;\nimport android.preference.PreferenceFragment;\nimport"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/ui/fragments/SettingFragment.java",
    "chars": 10820,
    "preview": "package com.lguipeng.notes.ui.fragments;\n\nimport android.content.ActivityNotFoundException;\nimport android.content.Dialo"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/AccountUtils.java",
    "chars": 2286,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.accounts.Account;\nimport android.accounts.AccountManager;\nimport andro"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/JsonUtils.java",
    "chars": 1282,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.text.TextUtils;\n\nimport com.alibaba.fastjson.JSON;\nimport com.lguipeng"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/NoteConfig.java",
    "chars": 583,
    "preview": "package com.lguipeng.notes.utils;\n\n/**\n * Created by lgp on 2015/5/25.\n */\npublic class NoteConfig {\n\n    public final s"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/NotesLog.java",
    "chars": 2737,
    "preview": "/***\n This is free and unencumbered software released into the public domain.\n Anyone is free to copy, modify, publish, "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/PreferenceUtils.java",
    "chars": 2388,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\n\nimport com"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/SnackbarUtils.java",
    "chars": 1267,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.app.Activity;\nimport android.graphics.Color;\n\nimport com.lguipeng.note"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/ThemeUtils.java",
    "chars": 1852,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.app.Activity;\n\nimport com.lguipeng.notes.R;\n\n/**\n * Created by lgp on "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/TimeUtils.java",
    "chars": 2899,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.content.Context;\n\nimport com.lguipeng.notes.R;\n\nimport java.text.Simpl"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/ViewHelper.java",
    "chars": 821,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.support.v4.view.ViewCompat;\nimport android.view.View;\n\n/**\n * Created "
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/utils/WXUtils.java",
    "chars": 5630,
    "preview": "package com.lguipeng.notes.utils;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.CompressFormat;\nimport"
  },
  {
    "path": "app/src/main/java/com/lguipeng/notes/view/FixedRecyclerView.java",
    "chars": 927,
    "preview": "package com.lguipeng.notes.view;\n\nimport android.content.Context;\nimport android.support.v7.widget.RecyclerView;\nimport "
  },
  {
    "path": "app/src/main/res/drawable/activated_background.xml",
    "chars": 483,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "app/src/main/res/drawable/blue_grey_round.xml",
    "chars": 181,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/blue_round.xml",
    "chars": 176,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/brown_round.xml",
    "chars": 177,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/deep_purple_round.xml",
    "chars": 183,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/green_round.xml",
    "chars": 177,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/pink_round.xml",
    "chars": 176,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/red_round.xml",
    "chars": 175,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/selectable_background.xml",
    "chars": 278,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item a"
  },
  {
    "path": "app/src/main/res/drawable/toolbar_shadow.xml",
    "chars": 284,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/white_button_background.xml",
    "chars": 226,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/yellow_round.xml",
    "chars": 178,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/layout/activity_about.xml",
    "chars": 4174,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/activity_edit_note_type.xml",
    "chars": 1196,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 3704,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/activity_note.xml",
    "chars": 2918,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/layout/activity_pay.xml",
    "chars": 1005,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/activity_setting.xml",
    "chars": 573,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/colors_image_layout.xml",
    "chars": 662,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andro"
  },
  {
    "path": "app/src/main/res/layout/colors_panel_layout.xml",
    "chars": 489,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<GridView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:"
  },
  {
    "path": "app/src/main/res/layout/drawer_list_item_layout.xml",
    "chars": 829,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/layout/edit_layout.xml",
    "chars": 375,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.rengwuxian.materialedittext.MaterialEditText\n    xmlns:android=\"http://schem"
  },
  {
    "path": "app/src/main/res/layout/md_simplelist_item.xml",
    "chars": 1408,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/layout/notes_item_layout.xml",
    "chars": 3151,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.balysv.materialripple.MaterialRippleLayout\n    xmlns:android=\"http://schemas"
  },
  {
    "path": "app/src/main/res/layout/toolbar_layout.xml",
    "chars": 340,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.Toolbar\n    xmlns:android=\"http://schemas.android.com/"
  },
  {
    "path": "app/src/main/res/layout/toolbar_shadow_layout.xml",
    "chars": 232,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<View\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:"
  },
  {
    "path": "app/src/main/res/menu/menu_about.xml",
    "chars": 347,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"h"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "chars": 1004,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:ap"
  },
  {
    "path": "app/src/main/res/menu/menu_note.xml",
    "chars": 330,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"h"
  },
  {
    "path": "app/src/main/res/menu/menu_notes_more.xml",
    "chars": 393,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n     "
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 1679,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"red\">#FF6347</color>\n    <color name=\"dark_red\">#F45"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 430,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <dimen name=\"md_simplelist_icon\">40dp</dimen>\n    <dimen name=\"md"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 4097,
    "preview": "<resources>\n    <string name=\"app_name\">极简笔记</string>\n    <string name=\"app_desc\">极简笔记,简洁精美的记事应用</string>\n    <string na"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 7936,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.NoActionBar\">\n "
  },
  {
    "path": "app/src/main/res/xml/prefs.xml",
    "chars": 1877,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    "
  },
  {
    "path": "app/src/main/res/xml/searchable.xml",
    "chars": 198,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<searchable xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    androi"
  },
  {
    "path": "build.gradle",
    "chars": 644,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 232,
    "preview": "#Wed Apr 10 15:27:10 PDT 2013\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 1039,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 5080,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "orm-library/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "orm-library/build.gradle",
    "chars": 483,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 22\n    buildToolsVersion \"22.0.1\"\n\n    defaultConfi"
  },
  {
    "path": "orm-library/orm-library.iml",
    "chars": 7284,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":orm-library\" external.linked.project.path=\"$"
  },
  {
    "path": "orm-library/proguard-rules.pro",
    "chars": 668,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in E:"
  },
  {
    "path": "orm-library/src/androidTest/java/com/lguipeng/library/ApplicationTest.java",
    "chars": 351,
    "preview": "package com.lguipeng.library;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href="
  },
  {
    "path": "orm-library/src/main/AndroidManifest.xml",
    "chars": 213,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"com.lguipeng.library\">\n\n    <application a"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/FinalDb.java",
    "chars": 21615,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/Id.java",
    "chars": 1130,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/ManyToOne.java",
    "chars": 971,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/OneToMany.java",
    "chars": 966,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/Property.java",
    "chars": 1013,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/Table.java",
    "chars": 953,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/annotation/sqlite/Transient.java",
    "chars": 936,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/AbstractCollection.java",
    "chars": 15907,
    "preview": "/*\n *  Licensed to the Apache Software Foundation (ASF) under one or more\n *  contributor license agreements.  See the N"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/ArrayDeque.java",
    "chars": 28647,
    "preview": "/*\n * Written by Josh Bloch of Google Inc. and released to the public domain,\n * as explained at http://creativecommons."
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/Arrays.java",
    "chars": 90121,
    "preview": "/*\n *  Licensed to the Apache Software Foundation (ASF) under one or more\n *  contributor license agreements.  See the N"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/AsyncTask.java",
    "chars": 18866,
    "preview": "package net.tsz.afinal.core;\n\nimport android.os.Handler;\nimport android.os.Message;\nimport android.os.Process;\n\nimport j"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/Deque.java",
    "chars": 22211,
    "preview": "/*\n * Written by Doug Lea and Josh Bloch with assistance from members of\n * JCP JSR-166 Expert Group and released to the"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/FileNameGenerator.java",
    "chars": 1628,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/core/Queue.java",
    "chars": 7823,
    "preview": "/*\n * Written by Doug Lea with assistance from members of JCP JSR-166\n * Expert Group and released to the public domain,"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/CursorUtils.java",
    "chars": 4090,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/DbModel.java",
    "chars": 1532,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/ManyToOneLazyLoader.java",
    "chars": 1148,
    "preview": "package net.tsz.afinal.db.sqlite;\n\nimport net.tsz.afinal.FinalDb;\n\n/**\n *\n * 一对多延迟加载类\n * Created by pwy on 13-7-25.\n * @"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/OneToManyLazyLoader.java",
    "chars": 1035,
    "preview": "package net.tsz.afinal.db.sqlite;\n\nimport net.tsz.afinal.FinalDb;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/SqlBuilder.java",
    "chars": 11654,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/sqlite/SqlInfo.java",
    "chars": 895,
    "preview": "package net.tsz.afinal.db.sqlite;\n\nimport java.util.LinkedList;\n\npublic class SqlInfo {\n\t\n\tprivate String sql;\n\tprivate "
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/Id.java",
    "chars": 704,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/KeyValue.java",
    "chars": 1225,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/ManyToOne.java",
    "chars": 887,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/OneToMany.java",
    "chars": 878,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/Property.java",
    "chars": 3714,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/db/table/TableInfo.java",
    "chars": 3890,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/exception/AfinalException.java",
    "chars": 1009,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/exception/DbException.java",
    "chars": 978,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/utils/ClassUtils.java",
    "chars": 7696,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/utils/FieldUtils.java",
    "chars": 9415,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/java/net/tsz/afinal/utils/Utils.java",
    "chars": 4528,
    "preview": "/**\n * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com).\n *\n * Licensed under the Apache License, Version 2"
  },
  {
    "path": "orm-library/src/main/res/values/strings.xml",
    "chars": 70,
    "preview": "<resources>\n    <string name=\"app_name\">library</string>\n</resources>\n"
  },
  {
    "path": "settings.gradle",
    "chars": 54,
    "preview": "include ':app', ':orm-library', ':MaterialPreference'\n"
  }
]

// ... and 4 more files (download for full content)

About this extraction

This page contains the full source code of the daimajia/Notes GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 157 files (501.5 KB), approximately 126.4k tokens, and a symbol index with 898 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!