├── .gitignore ├── .idea ├── gradle.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── build.gradle ├── gif └── qr_code.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── notes ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── wuzhanglao │ │ ├── adapter │ │ ├── BaseAdapter.java │ │ ├── ImageHolderAdapter.java │ │ ├── LoadImageHelper.java │ │ ├── MultiTypeAdapter.java │ │ ├── SubMultiTypeAdapter.java │ │ └── TextHolderAdatpter.java │ │ ├── base │ │ ├── BaseActivity.java │ │ ├── BaseFragment.java │ │ ├── DefaultToolbar.java │ │ ├── TransparentStatusActivity.java │ │ └── mvp │ │ │ ├── BaseMvpModel.java │ │ │ ├── BaseMvpPresenter.java │ │ │ └── BaseMvpView.java │ │ ├── bean │ │ ├── RxBusBean.java │ │ └── TextBean.java │ │ ├── event │ │ ├── BaseEvent.java │ │ └── TextEvent.java │ │ ├── fragment │ │ ├── ApproveListFragment.java │ │ ├── BannerFragment.java │ │ ├── BaseMvpFragment.java │ │ ├── BezierFragment.java │ │ ├── BottomBarFragment.java │ │ ├── CountDownFragment.java │ │ ├── DragRefreshFragment.java │ │ ├── FloatViewFragment.java │ │ ├── GuaGuaKaFragment.java │ │ ├── LearnPatternFragment.java │ │ ├── LoadImageFragment.java │ │ ├── NavigationFragment.java │ │ ├── NetworkFragment.java │ │ ├── TBHeadlineFragment.java │ │ ├── TestMeasureLayoutFragment.java │ │ ├── TimerViewFragment.java │ │ ├── TranslationFragment.java │ │ └── ViewPagerFragment.java │ │ ├── holder │ │ ├── EmptyViewHolder.java │ │ ├── HeadlineHolder.java │ │ ├── ImageHolder.java │ │ └── TextHolder.java │ │ ├── home │ │ ├── HomeActivity.java │ │ ├── HomeMvpModel.java │ │ ├── HomeMvpPresenter.java │ │ ├── HomeMvpView.java │ │ ├── TestRxActivity1.java │ │ ├── TestRxActivity2.java │ │ ├── ThirdActivity.java │ │ └── TransparentStatusActivity.java │ │ ├── misc │ │ ├── DemoActivity.java │ │ ├── RectCornerLayout.java │ │ ├── RoundCornerLayout.java │ │ ├── SplashActivity.java │ │ └── StartTempQQChatActivity.java │ │ ├── mvp │ │ ├── model │ │ │ ├── HeWeatherBean.java │ │ │ ├── HeadlineBean.java │ │ │ └── ShanbayResp.java │ │ ├── presenter │ │ │ ├── ApproveListFragmentPresenter.java │ │ │ ├── BaseMvpPresenter.java │ │ │ ├── HighlightFragmentPresenter.java │ │ │ ├── LoadImageFragmentPresenter.java │ │ │ └── NetworkFragmentPresenter.java │ │ └── view │ │ │ ├── ApproveListFragmentView.java │ │ │ ├── BaseMvpView.java │ │ │ ├── HighlightFragmentView.java │ │ │ ├── LoadImageFragmentView.java │ │ │ └── NetworkFragmentView.java │ │ ├── utils │ │ ├── AppUtils.java │ │ ├── BitmapFileCache.java │ │ ├── GlobleConfig.java │ │ ├── ITest.java │ │ ├── LogUtils.java │ │ ├── NetworkRequest.java │ │ ├── NetworkService.java │ │ ├── NetworkUtil.java │ │ ├── NoteApplication.java │ │ ├── RxBus.java │ │ ├── ToastUtil.java │ │ ├── UIUtils.java │ │ ├── nine_old_android │ │ │ ├── AnimatorProxy.java │ │ │ ├── FloatProperty.java │ │ │ ├── IntProperty.java │ │ │ ├── NoSuchPropertyException.java │ │ │ ├── PreHoneycombCompat.java │ │ │ ├── Property.java │ │ │ ├── ReflectiveProperty.java │ │ │ └── ViewHelper.java │ │ └── transformer │ │ │ ├── BaseTransformer.java │ │ │ ├── CubeInTransformer.java │ │ │ ├── CubeOutTransformer.java │ │ │ └── RotateUpTransformer.java │ │ ├── view │ │ ├── ExoPlayerDemo.java │ │ ├── HorizontalProgressDemo.java │ │ ├── PatternDemo.java │ │ └── TimerDemo.java │ │ └── widget │ │ ├── ApproveListLayout.java │ │ ├── ArrowView.java │ │ ├── Banner.java │ │ ├── BezierView.java │ │ ├── BiliBiliBarrage.java │ │ ├── BottomBar.java │ │ ├── ClickableTextView.java │ │ ├── CountDownView.java │ │ ├── CustomClock.java │ │ ├── DragRefreshLayout.java │ │ ├── ExpandableTextView.java │ │ ├── FloatViewLayout.java │ │ ├── GuaGuaKa.java │ │ ├── HighlightPhraseView.java │ │ ├── HorizontalProgressView.java │ │ ├── IndicatorDialog.java │ │ ├── NumberTipView.java │ │ ├── ProgressChartView.java │ │ ├── RippleView.java │ │ ├── RoundCornerLayout.java │ │ ├── RoundDrawable.java │ │ ├── RoundImageView.java │ │ ├── TaobaoHeadline.java │ │ ├── TestMeasureLayout.java │ │ ├── TimerView.java │ │ └── TranslationDialog.java │ └── res │ ├── anim │ ├── cube_in.xml │ ├── cube_out.xml │ ├── headline_in.xml │ ├── headline_out.xml │ ├── ios_dialog_enter.xml │ └── ios_dialog_exit.xml │ ├── drawable │ ├── arrow.png │ ├── avatar.jpg │ ├── bg_splash.xml │ ├── bottom_dialog_cancel.xml │ ├── bottom_dialog_option1.xml │ ├── bottom_dialog_option13.xml │ ├── bottom_dialog_option2.xml │ ├── bottom_dialog_option3.xml │ ├── btn_bg_colorfff_radius3.xml │ ├── default_avatar.png │ ├── default_img.jpg │ ├── headline.jpg │ ├── headline_title.xml │ ├── heart.png │ ├── ic_toolbar_share_light.xml │ ├── icon_app.png │ ├── icon_down.png │ ├── icon_right.png │ ├── icon_toolbar_back_light.xml │ ├── icon_update.png │ ├── img1.jpg │ ├── img2.jpg │ ├── img3.jpg │ ├── img4.jpg │ ├── mail.png │ ├── navi_bg.jpg │ ├── red_dot.xml │ ├── shape_gradient_white.xml │ ├── shape_headline.xml │ ├── shape_white_border_with_corner.xml │ ├── shape_white_border_with_corner2.xml │ ├── splash_logo.png │ └── splash_text.png │ ├── layout │ ├── activity_demo.xml │ ├── activity_home.xml │ ├── activity_splash.xml │ ├── activity_start_temp_qq_chat.xml │ ├── activity_test_rxbus1.xml │ ├── activity_test_rxbus2.xml │ ├── activity_third.xml │ ├── activity_translucent_status.xml │ ├── bottom_bar_view.xml │ ├── dialog_translation.xml │ ├── fragment_anim.xml │ ├── fragment_approve_list.xml │ ├── fragment_bezier.xml │ ├── fragment_bottom_bar.xml │ ├── fragment_bottom_dialog.xml │ ├── fragment_countdown.xml │ ├── fragment_drag_refresh.xml │ ├── fragment_float_view.xml │ ├── fragment_glide.xml │ ├── fragment_guaguaka.xml │ ├── fragment_highlight.xml │ ├── fragment_learn_pattern.xml │ ├── fragment_loadimage.xml │ ├── fragment_navigation.xml │ ├── fragment_network.xml │ ├── fragment_taobao_headline.xml │ ├── fragment_test_measure_layout.xml │ ├── fragment_viewpager.xml │ ├── headline_holder.xml │ ├── image_holder.xml │ ├── ios_bottom_dialog.xml │ ├── ios_dialog_item.xml │ ├── layout_center.xml │ ├── layout_demo_exo_player.xml │ ├── layout_demo_horizontal_progress.xml │ ├── layout_demo_pattern.xml │ ├── layout_demo_timer.xml │ ├── layout_footer.xml │ ├── layout_header.xml │ ├── layout_toolbar_default.xml │ ├── refresh_layout_header.xml │ ├── taobao_headline_layout.xml │ ├── text_holder.xml │ └── toolbar_general.xml │ ├── mipmap-hdpi │ └── notes.png │ ├── mipmap-mdpi │ └── notes.png │ ├── mipmap-xhdpi │ └── notes.png │ ├── mipmap-xxhdpi │ └── notes.png │ ├── mipmap-xxxhdpi │ └── notes.png │ ├── values-v19 │ └── styles.xml │ ├── values-v21 │ └── styles.xml │ └── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle/ 3 | /local.properties 4 | .idea/ 5 | .DS_Store 6 | /build -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:3.1.3' 8 | classpath 'com.antfortune.freeline:gradle:0.8.8' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | mavenCentral() 17 | } 18 | } -------------------------------------------------------------------------------- /gif/qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/gif/qr_code.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Sep 28 11:19:21 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /notes/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /notes/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '27.0.3' 6 | defaultConfig { 7 | applicationId "com.wuzhanglao.niubi" 8 | minSdkVersion 16 9 | targetSdkVersion 27 10 | versionCode 1 11 | versionName "1.0.0" 12 | 13 | manifestPlaceholders = [KEY_UMENG: '5810166a7666132fe5002154'] 14 | } 15 | 16 | signingConfigs { 17 | release { 18 | Properties properties = new Properties() 19 | properties.load(project.rootProject.file("local.properties").newDataInputStream()) 20 | if (properties.getProperty("FLAG") != null) { 21 | storeFile file(KEYSTORE_FILE) 22 | storePassword KEYSTORE_PASSWORD 23 | keyAlias KEYSTORE_ALIAS 24 | keyPassword KEYSTORE_ALIAS_PASSWORD 25 | } 26 | } 27 | } 28 | 29 | buildTypes { 30 | debug { 31 | debuggable true 32 | versionNameSuffix "-debug" 33 | applicationIdSuffix ".debug" 34 | resValue "string", "app_name", "Notes测试版" 35 | } 36 | 37 | release { 38 | debuggable false 39 | //混淆 40 | minifyEnabled true 41 | //Zipalign优化 42 | zipAlignEnabled true 43 | //移除无用的resource文件 44 | shrinkResources true 45 | //加载默认混淆配置文件 46 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 47 | //apk打包的时候需要签名 48 | signingConfig signingConfigs.release 49 | 50 | resValue "string", "app_name", "Notes正式版本" 51 | } 52 | } 53 | 54 | dexOptions { 55 | preDexLibraries true 56 | dexInProcess = true 57 | javaMaxHeapSize "4g" 58 | } 59 | } 60 | 61 | dependencies { 62 | implementation fileTree(include: ['*.jar'], dir: 'libs') 63 | // compile 'com.android.support:multidex:1.0.1' 64 | implementation 'com.android.support:cardview-v7:27.1.1' 65 | implementation 'com.android.support:support-v4:27.1.1' 66 | implementation 'com.android.support:appcompat-v7:27.1.1' 67 | implementation 'com.android.support:recyclerview-v7:27.1.1' 68 | implementation 'com.android.support:design:27.1.1' 69 | //glide 70 | implementation 'com.github.bumptech.glide:glide:4.7.1' 71 | //rxjava 72 | implementation 'io.reactivex:rxjava:1.3.0' 73 | implementation 'io.reactivex:rxandroid:1.2.1' 74 | //rx-lifecycle 75 | implementation 'com.trello:rxlifecycle:0.5.0' 76 | implementation 'com.trello:rxlifecycle-components:0.5.0' 77 | //retrofit 78 | implementation 'com.squareup.retrofit2:retrofit:2.3.0' 79 | implementation 'com.squareup.retrofit2:converter-gson:2.3.0' 80 | implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0' 81 | //okhttp 82 | implementation 'com.squareup.okhttp3:okhttp:3.9.0' 83 | implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' 84 | //友盟统计 85 | //compile 'com.umeng.analytics:analytics:latest.integration' 86 | //监听网络状态 87 | implementation 'com.github.pwittchen:reactivenetwork:0.8.0' 88 | //event bus 89 | implementation 'org.greenrobot:eventbus:3.0.0' 90 | //logger 91 | implementation 'com.orhanobut:logger:1.15' 92 | //blur 93 | implementation 'jp.wasabeef:blurry:2.1.1' 94 | } 95 | -------------------------------------------------------------------------------- /notes/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/wuming/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | #友盟混淆 20 | -keep public class com.wuzhanglao.niubi.R$*{ 21 | public static final int *; 22 | } 23 | -keepclassmembers enum * { 24 | public static **[] values(); 25 | public static ** valueOf(java.lang.Strgiing); 26 | } 27 | 28 | -dontwarn okio.** 29 | -dontwarn retrofit2.** 30 | 31 | #RxJava混淆 32 | #-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { 33 | # rx.internal.util.atomic.LinkedQueueNode producerNode; 34 | #} 35 | #-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef { 36 | # rx.internal.util.atomic.LinkedQueueNode consumerNode; 37 | #} 38 | -keepclassmembers class rx.internal.util.unsafe.** { 39 | long producerIndex; 40 | long consumerIndex; 41 | } 42 | -dontwarn rx.internal.util.unsafe.** 43 | -------------------------------------------------------------------------------- /notes/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 44 | 45 | 48 | 49 | 52 | 53 | 56 | 57 | 60 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/adapter/ImageHolderAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | import com.wuzhanglao.niubi.holder.ImageHolder; 9 | 10 | /* 11 | * Created by wuming on 2016/12/3. 12 | */ 13 | 14 | public class ImageHolderAdapter extends BaseAdapter { 15 | 16 | public ImageHolderAdapter(Context context) { 17 | super(context); 18 | } 19 | 20 | @Override 21 | protected ImageHolder onCreateHolder(ViewGroup parent, int viewType) { 22 | return new ImageHolder(mInflater.inflate(R.layout.image_holder, parent, false)); 23 | } 24 | 25 | @Override 26 | protected void onBindHolder(ImageHolder holder, int position_in_data) { 27 | final String url = getItem(position_in_data); 28 | if (position_in_data == getItemCount() - 1) { 29 | holder.line.setVisibility(View.GONE); 30 | } else { 31 | holder.line.setVisibility(View.VISIBLE); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/adapter/LoadImageHelper.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.adapter; 2 | 3 | import android.content.Context; 4 | import android.os.Handler; 5 | import android.support.v4.widget.SwipeRefreshLayout; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.util.Log; 9 | 10 | /** 11 | * Created by wuming on 2016/12/3. 12 | */ 13 | 14 | public class LoadImageHelper extends RecyclerView.OnScrollListener implements SwipeRefreshLayout.OnRefreshListener { 15 | private static final String TAG = LoadImageHelper.class.getSimpleName(); 16 | private Context context; 17 | private SwipeRefreshLayout swipeRefreshLayout; 18 | private ImageHolderAdapter adapter; 19 | private RecyclerView recyclerView; 20 | private LinearLayoutManager layoutManager; 21 | private Handler handler = new Handler(); 22 | private boolean isLoading = false; 23 | 24 | public LoadImageHelper(Context context) { 25 | this.context = context; 26 | } 27 | 28 | public void setSwipeRefreshLayout(SwipeRefreshLayout swipeRefreshLayout) { 29 | this.swipeRefreshLayout = swipeRefreshLayout; 30 | } 31 | 32 | public void setAdapter(ImageHolderAdapter adapter) { 33 | this.adapter = adapter; 34 | } 35 | 36 | public void setRecyclerView(RecyclerView recyclerView) { 37 | this.recyclerView = recyclerView; 38 | } 39 | 40 | public void init() { 41 | layoutManager = new LinearLayoutManager(context); 42 | recyclerView.setLayoutManager(layoutManager); 43 | recyclerView.setAdapter(adapter); 44 | recyclerView.addOnScrollListener(this); 45 | swipeRefreshLayout.setOnRefreshListener(this); 46 | } 47 | 48 | @Override 49 | public void onRefresh() { 50 | handler.postDelayed(new Runnable() { 51 | @Override 52 | public void run() { 53 | swipeRefreshLayout.setRefreshing(false); 54 | } 55 | }, 3000); 56 | } 57 | 58 | @Override 59 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 60 | if (layoutManager.findLastVisibleItemPosition() == adapter.getItemCount() - 1) { 61 | if (!isLoading) { 62 | isLoading = true; 63 | Log.d(TAG, "加载更多..."); 64 | handler.postDelayed(new Runnable() { 65 | @Override 66 | public void run() { 67 | isLoading = false; 68 | } 69 | }, 10000); 70 | } 71 | } 72 | 73 | int a = 0; 74 | 75 | { 76 | System.out.print(""); 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/adapter/SubMultiTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.adapter; 2 | 3 | import android.app.Activity; 4 | import android.support.annotation.NonNull; 5 | import android.view.ViewGroup; 6 | 7 | /** 8 | * Created by ming.wu@shanbay.com on 2017/6/23. 9 | */ 10 | 11 | public class SubMultiTypeAdapter extends MultiTypeAdapter { 12 | 13 | public static final int Type_ITEM_A = 0x011; 14 | public static final int Type_ITEM_B = 0x022; 15 | public static final int Type_ITEM_C = 0x033; 16 | 17 | public SubMultiTypeAdapter(Activity activity) { 18 | super(activity); 19 | } 20 | 21 | /** 22 | * register sub item type here 23 | * 24 | * @param type 25 | */ 26 | @Override 27 | protected void registerItemType(int type) { 28 | } 29 | 30 | public interface Callback extends MultiTypeAdapter.Callback { 31 | void onAction(); 32 | } 33 | 34 | private class MultiTypeSubManager extends MultiTypeAdapter.Manager { 35 | 36 | @NonNull 37 | @Override 38 | public Class bindData() { 39 | return getClass(); 40 | } 41 | 42 | @Override 43 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent) { 44 | 45 | return null; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/adapter/TextHolderAdatpter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Color; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | 8 | import com.wuzhanglao.niubi.R; 9 | import com.wuzhanglao.niubi.bean.TextBean; 10 | import com.wuzhanglao.niubi.holder.TextHolder; 11 | 12 | /** 13 | * Created by wuming on 16/10/13. 14 | */ 15 | 16 | public class TextHolderAdatpter extends BaseAdapter { 17 | private TextHolderClickListener mListener; 18 | 19 | public TextHolderAdatpter(Context context) { 20 | super(context); 21 | } 22 | 23 | @Override 24 | protected TextHolder onCreateHolder(ViewGroup parent, int viewType) { 25 | return new TextHolder(mInflater.inflate(R.layout.text_holder, parent, false)); 26 | } 27 | 28 | @Override 29 | protected void onBindHolder(TextHolder holder, int position) { 30 | holder.num_tv.setText(position + 1 < 10 ? "0" + (position + 1) : "" + (position + 1)); 31 | holder.title_tv.setText(getItem(position).getTitle()); 32 | holder.subtitle_tv.setText(getItem(position).getSubTitle()); 33 | if (position < 2) { 34 | holder.num_tv.setTextColor(Color.WHITE); 35 | holder.num_tv.setBackgroundColor(Color.parseColor("#FF1111")); 36 | } else { 37 | holder.num_tv.setTextColor(Color.DKGRAY); 38 | holder.num_tv.setBackgroundColor(Color.WHITE); 39 | } 40 | if (position + 1 == getItemCount()) { 41 | holder.line.setVisibility(View.GONE); 42 | } else { 43 | holder.line.setVisibility(View.VISIBLE); 44 | } 45 | ((ViewGroup) holder.num_tv.getParent()).setOnClickListener(new OnTextClick(position)); 46 | } 47 | 48 | private class OnTextClick implements View.OnClickListener { 49 | 50 | private int position; 51 | 52 | public OnTextClick(int position) { 53 | this.position = position; 54 | } 55 | 56 | @Override 57 | public void onClick(View v) { 58 | if (mListener != null) { 59 | mListener.onTextClick(position); 60 | } 61 | } 62 | } 63 | 64 | public void setTextHolderClickListener(TextHolderClickListener listener) { 65 | this.mListener = listener; 66 | } 67 | 68 | public interface TextHolderClickListener { 69 | void onTextClick(int position); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.trello.rxlifecycle.components.support.RxAppCompatActivity; 6 | 7 | /* 8 | * Created by wuming on 16/10/13. 9 | */ 10 | 11 | public abstract class BaseActivity extends RxAppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | } 17 | 18 | @Override 19 | protected void onResume() { 20 | super.onResume(); 21 | // MobclickAgent.onResume(this); 22 | } 23 | 24 | public void onPause() { 25 | super.onPause(); 26 | // MobclickAgent.onPause(this); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base; 2 | 3 | import android.graphics.Color; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.View; 8 | 9 | /** 10 | * Created by wuming on 16/10/14. 11 | */ 12 | 13 | public abstract class BaseFragment extends Fragment { 14 | 15 | @Override 16 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 17 | view.setClickable(true); 18 | view.setBackgroundColor(Color.WHITE); 19 | } 20 | 21 | @Override 22 | public void onResume() { 23 | super.onResume(); 24 | // MobclickAgent.onPageStart(getClass().getSimpleName()); 25 | } 26 | 27 | @Override 28 | public void onPause() { 29 | super.onPause(); 30 | // MobclickAgent.onPageEnd(getClass().getSimpleName()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/DefaultToolbar.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base; 2 | 3 | import android.view.View; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | 9 | /** 10 | * Created by ming.wu@shanbay.com on 2017/6/19. 11 | */ 12 | 13 | public class DefaultToolbar implements View.OnClickListener { 14 | private BaseActivity mActivity; 15 | private TextView mTvTitle; 16 | private ImageView mIvBack; 17 | private TextView mTvRightText; 18 | private ImageView mIvRightIcon; 19 | 20 | public DefaultToolbar(BaseActivity activity) { 21 | mActivity = activity; 22 | mTvTitle = (TextView) activity.findViewById(R.id.default_toolbar_title); 23 | mIvBack = (ImageView) activity.findViewById(R.id.default_toolbar_back); 24 | mTvRightText = (TextView) activity.findViewById(R.id.default_toolbar_right_text); 25 | mIvRightIcon = (ImageView) activity.findViewById(R.id.default_toolbar_right_icon); 26 | 27 | mIvBack.setOnClickListener(this); 28 | } 29 | 30 | public void setmTvTitle(CharSequence mTvTitle) { 31 | this.mTvTitle.setText(mTvTitle); 32 | } 33 | 34 | @Override 35 | public void onClick(View v) { 36 | switch (v.getId()) { 37 | case R.id.default_toolbar_back: 38 | mActivity.onBackPressed(); 39 | break; 40 | } 41 | } 42 | 43 | public void hideBackIcon() { 44 | mIvBack.setVisibility(View.GONE); 45 | } 46 | 47 | public void showRightIcon(View.OnClickListener listener) { 48 | mIvRightIcon.setOnClickListener(listener); 49 | mIvRightIcon.setVisibility(View.VISIBLE); 50 | mTvRightText.setVisibility(View.GONE); 51 | } 52 | 53 | public void showRightText(String text, View.OnClickListener listener) { 54 | mIvRightIcon.setVisibility(View.GONE); 55 | mTvRightText.setText(text); 56 | mTvRightText.setOnClickListener(listener); 57 | mTvRightText.setVisibility(View.VISIBLE); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/TransparentStatusActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base; 2 | 3 | import android.graphics.Color; 4 | import android.os.Build; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.view.WindowManager; 8 | 9 | /** 10 | * Created by ming.wu@shanbay.com on 2017/5/7. 11 | */ 12 | 13 | // TODO: 2017/6/25 这里是abstract 14 | public abstract class TransparentStatusActivity extends BaseActivity { 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 18 | //全透明状态栏(不带阴影) 19 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); 20 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 21 | getWindow().setStatusBarColor(Color.TRANSPARENT); 22 | } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 23 | //半透明状态栏(带阴影) 24 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 25 | } 26 | super.onCreate(savedInstanceState); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/mvp/BaseMvpModel.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base.mvp; 2 | 3 | /** 4 | * create by wuzhanglao at 2017/8/30 5 | */ 6 | 7 | public abstract class BaseMvpModel { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/mvp/BaseMvpPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base.mvp; 2 | 3 | public abstract class BaseMvpPresenter { 4 | 5 | private V mView; 6 | private M mModel; 7 | 8 | public final void attach() { 9 | onAttach(); 10 | } 11 | 12 | public final void detach() { 13 | onDetach(); 14 | mView = null; 15 | } 16 | 17 | public void onAttach() { 18 | 19 | } 20 | 21 | public void onDetach() { 22 | } 23 | 24 | public V getView() { 25 | return mView; 26 | } 27 | 28 | public void setView(V view) { 29 | mView = view; 30 | } 31 | 32 | public M getModel(){ 33 | return mModel; 34 | } 35 | 36 | public void setModel(M model){ 37 | mModel = model; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/base/mvp/BaseMvpView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.base.mvp; 2 | 3 | import com.wuzhanglao.niubi.base.BaseActivity; 4 | 5 | public abstract class BaseMvpView { 6 | 7 | private BaseActivity mActivity; 8 | private T mCallback; 9 | 10 | public BaseMvpView(BaseActivity activity) { 11 | mActivity = activity; 12 | } 13 | 14 | public BaseActivity getActivity() { 15 | return mActivity; 16 | } 17 | 18 | public void setCallback(T callback) { 19 | mCallback = callback; 20 | } 21 | 22 | public T getCallback() { 23 | return mCallback; 24 | } 25 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/bean/RxBusBean.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.bean; 2 | 3 | import com.google.gson.Gson; 4 | 5 | /** 6 | * Created by wuming on 2016/12/2. 7 | */ 8 | 9 | public class RxBusBean { 10 | private String from; 11 | private String to; 12 | private String content; 13 | 14 | public RxBusBean() { 15 | 16 | } 17 | 18 | public RxBusBean(String from, String to, String content) { 19 | this.from = from; 20 | this.to = to; 21 | this.content = content; 22 | } 23 | 24 | public String getFrom() { 25 | return from; 26 | } 27 | 28 | public void setFrom(String from) { 29 | this.from = from; 30 | } 31 | 32 | public String getTo() { 33 | return to; 34 | } 35 | 36 | public void setTo(String to) { 37 | this.to = to; 38 | } 39 | 40 | public String getContent() { 41 | return content; 42 | } 43 | 44 | public void setContent(String content) { 45 | this.content = content; 46 | Gson gson = new Gson(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/bean/TextBean.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.bean; 2 | 3 | /** 4 | * Created by wuming on 2016/12/6. 5 | */ 6 | 7 | public class TextBean { 8 | private String title; 9 | private String subTitle; 10 | 11 | public TextBean() { 12 | 13 | } 14 | 15 | public TextBean(String title, String subTitle) { 16 | this.title = title; 17 | this.subTitle = subTitle; 18 | } 19 | 20 | public String getSubTitle() { 21 | return subTitle; 22 | } 23 | 24 | public void setSubTitle(String subTitle) { 25 | this.subTitle = subTitle; 26 | } 27 | 28 | public String getTitle() { 29 | return title; 30 | } 31 | 32 | public void setTitle(String title) { 33 | this.title = title; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/event/BaseEvent.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.event; 2 | 3 | /** 4 | * Created by ming.wu@shanbay.com on 2017/4/19. 5 | */ 6 | 7 | public abstract class BaseEvent { 8 | } 9 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/event/TextEvent.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.event; 2 | 3 | /** 4 | * Created by ming.wu@shanbay.com on 2017/4/19. 5 | */ 6 | 7 | public class TextEvent extends BaseEvent { 8 | private String msg; 9 | 10 | public TextEvent(String msg) { 11 | this.msg = msg; 12 | } 13 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/BannerFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseFragment; 12 | import com.wuzhanglao.niubi.widget.Banner; 13 | 14 | /** 15 | * Created by wuming on 2016/11/10. 16 | */ 17 | 18 | public class BannerFragment extends BaseFragment { 19 | 20 | private Banner banner; 21 | 22 | @Nullable 23 | @Override 24 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 25 | View rootView = inflater.inflate(R.layout.fragment_viewpager, container, false); 26 | banner = (Banner) rootView.findViewById(R.id.fragment_viewpager_imagebanner); 27 | banner.addContent(getImageView(R.drawable.img1)); 28 | banner.addContent(getImageView(R.drawable.img2)); 29 | banner.addContent(getImageView(R.drawable.img4)); 30 | banner.startScroll(); 31 | return rootView; 32 | } 33 | 34 | private ImageView getImageView(int resId) { 35 | ImageView image = new ImageView(getContext()); 36 | image.setImageResource(resId); 37 | ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(100, 100); 38 | image.setLayoutParams(params); 39 | return image; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/BaseMvpFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | 6 | import com.wuzhanglao.niubi.base.BaseFragment; 7 | import com.wuzhanglao.niubi.mvp.presenter.BaseMvpPresenter; 8 | import com.wuzhanglao.niubi.mvp.view.BaseMvpView; 9 | 10 | /** 11 | * Created by wuming on 16/10/19. 12 | */ 13 | 14 | public abstract class BaseMvpFragment extends BaseFragment { 15 | 16 | public P presenter; 17 | 18 | @Override 19 | public void onCreate(@Nullable Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | presenter = initPresenter(); 22 | presenter.attachView((V) this); 23 | } 24 | 25 | @Override 26 | public void onDestroy() { 27 | super.onDestroy(); 28 | presenter.detachView(); 29 | } 30 | 31 | public abstract P initPresenter(); 32 | } 33 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/BezierFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | 12 | /** 13 | * Created by wuming on 2016/11/16. 14 | */ 15 | 16 | public class BezierFragment extends BaseFragment { 17 | @Nullable 18 | @Override 19 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 20 | return inflater.inflate(R.layout.fragment_bezier, container, false); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/BottomBarFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | import com.wuzhanglao.niubi.widget.BottomBar; 12 | 13 | /** 14 | * Created by wuming on 16/10/18. 15 | */ 16 | 17 | public class BottomBarFragment extends BaseFragment implements View.OnClickListener { 18 | 19 | private BottomBar bottomBar; 20 | 21 | @Nullable 22 | @Override 23 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 24 | View rootView = inflater.inflate(R.layout.fragment_bottom_bar, container, false); 25 | bottomBar = (BottomBar) rootView.findViewById(R.id.fragment_bottom_bar); 26 | rootView.findViewById(R.id.fragment_bottombar_add1_btn).setOnClickListener(this); 27 | rootView.findViewById(R.id.fragment_bottombar_add10_btn).setOnClickListener(this); 28 | rootView.findViewById(R.id.fragment_bottombar_delete1_btn).setOnClickListener(this); 29 | rootView.findViewById(R.id.fragment_bottombar_deleteall_btn).setOnClickListener(this); 30 | return super.onCreateView(inflater, container, savedInstanceState); 31 | } 32 | 33 | @Override 34 | public void onClick(View v) { 35 | switch (v.getId()) { 36 | case R.id.fragment_bottombar_add1_btn: 37 | bottomBar.add(); 38 | break; 39 | case R.id.fragment_bottombar_add10_btn: 40 | try { 41 | bottomBar.add(10); 42 | } catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | break; 46 | case R.id.fragment_bottombar_delete1_btn: 47 | bottomBar.delete(); 48 | break; 49 | case R.id.fragment_bottombar_deleteall_btn: 50 | bottomBar.deleteAll(); 51 | break; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/CountDownFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | import com.wuzhanglao.niubi.utils.AppUtils; 12 | import com.wuzhanglao.niubi.widget.CountDownView; 13 | 14 | /** 15 | * Created by wuming on 16/10/18. 16 | */ 17 | 18 | public class CountDownFragment extends BaseFragment { 19 | 20 | private CountDownView countDownView; 21 | 22 | 23 | @Nullable 24 | @Override 25 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 26 | View rootView = inflater.inflate(R.layout.fragment_countdown, container, false); 27 | countDownView = (CountDownView) rootView.findViewById(R.id.fragment_count_down); 28 | countDownView.setCountDownTimerListener(new CountDownView.CountDownTimerListener() { 29 | @Override 30 | public void onStartCount() { 31 | AppUtils.showToast("开始了"); 32 | } 33 | 34 | @Override 35 | public void onFinishCount() { 36 | AppUtils.showToast("结束了"); 37 | } 38 | }); 39 | rootView.findViewById(R.id.fragment_count_down_start_btn).setOnClickListener(new View.OnClickListener() { 40 | 41 | @Override 42 | public void onClick(View v) { 43 | countDownView.start(); 44 | } 45 | }); 46 | return rootView; 47 | } 48 | 49 | @Override 50 | public void onDestroy() { 51 | super.onDestroy(); 52 | countDownView.stop(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/DragRefreshFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.orhanobut.logger.Logger; 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseFragment; 12 | 13 | /** 14 | * Created by wuming on 2016/11/14. 15 | */ 16 | 17 | public class DragRefreshFragment extends BaseFragment { 18 | 19 | @Nullable 20 | @Override 21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 22 | 23 | Logger.d("测试Logger.d(d)"); 24 | Logger.t(1).d("测试Logger.d(d)"); 25 | Logger.t(2).d("测试Logger.d(d)"); 26 | Logger.t(3).d("测试Logger.d(d)"); 27 | Logger.d("message", "测试Logger.d(message,d)"); 28 | Logger.d("测试Logger.d(d)"); 29 | 30 | 31 | Logger.e("测试Logger.e(e)"); 32 | Logger.e("message", "测试Logger.e(message,e)"); 33 | 34 | 35 | Logger.i("测试Logger.i(i)"); 36 | Logger.i("message", "测试Logger.i(message,i)"); 37 | 38 | Logger.json("{\"name\":\"tom\",\"sex\":\"男\",\"age\":\"24\"}"); 39 | Logger.xml("\n" + 40 | " \n" + 41 | " \n" + 42 | " MARY\n" + 43 | " \n" + 44 | " \n" + 45 | " SCOTT\n" + 46 | " \n" + 47 | " "); 48 | 49 | 50 | return inflater.inflate(R.layout.fragment_drag_refresh, container, false); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/FloatViewFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | 12 | /** 13 | * Created by wuming on 2016/10/26. 14 | */ 15 | 16 | public class FloatViewFragment extends BaseFragment { 17 | 18 | @Nullable 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | return inflater.inflate(R.layout.fragment_float_view,container,false); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/GuaGuaKaFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | 12 | /** 13 | * Created by wuming on 2016/11/6. 14 | */ 15 | 16 | public class GuaGuaKaFragment extends BaseFragment { 17 | 18 | @Nullable 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | return inflater.inflate(R.layout.fragment_guaguaka,container,false); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/LearnPatternFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseFragment; 12 | 13 | import java.util.regex.Matcher; 14 | import java.util.regex.Pattern; 15 | 16 | /** 17 | * Created by ming.wu@shanbay.com on 2017/4/23. 18 | */ 19 | 20 | public class LearnPatternFragment extends BaseFragment { 21 | @Nullable 22 | @Override 23 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 24 | View rootView = inflater.inflate(R.layout.fragment_learn_pattern,container,false); 25 | TextView textView = (TextView) rootView.findViewById(R.id.learn_pattern_result); 26 | Pattern pattern = Pattern.compile("\\*\\*[\\w\\-\\.\\s]+\\*\\*"); 27 | Matcher matcher = pattern.matcher("word word is a **press**"); 28 | String s = "word word is a **press**"; 29 | // s.replaceAll("\"\\\\*\\\\*[\\\\w\\\\-\\\\.\\\\s]+\\\\*\\\\*\"") 30 | return rootView; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/LoadImageFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.widget.SwipeRefreshLayout; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.wuzhanglao.niubi.R; 12 | import com.wuzhanglao.niubi.adapter.ImageHolderAdapter; 13 | import com.wuzhanglao.niubi.adapter.LoadImageHelper; 14 | import com.wuzhanglao.niubi.mvp.presenter.LoadImageFragmentPresenter; 15 | import com.wuzhanglao.niubi.mvp.view.LoadImageFragmentView; 16 | 17 | import java.util.ArrayList; 18 | import java.util.Collections; 19 | import java.util.List; 20 | 21 | /* 22 | * Created by wuming on 2016/12/3. 23 | */ 24 | 25 | public class LoadImageFragment extends BaseMvpFragment 26 | implements LoadImageFragmentView { 27 | 28 | private LoadImageHelper mLoadImageHelper; 29 | private List mImageList = Collections.EMPTY_LIST; 30 | private ImageHolderAdapter mAdapter; 31 | 32 | @Override 33 | public LoadImageFragmentPresenter initPresenter() { 34 | return new LoadImageFragmentPresenter(); 35 | } 36 | 37 | private void initData() { 38 | mImageList = new ArrayList<>(); 39 | mImageList.add("https://static.baydn.com/media/media_store/image/f1672263006c6e28bb9dee7652fa4cf6.jpg"); 40 | mImageList.add("https://static.baydn.com/media/media_store/image/8c997fae9ebb2b22ecc098a379cc2ca3.jpg"); 41 | mImageList.add("https://static.baydn.com/media/media_store/image/2a4616f067285b4bd59fe5401cd7106b.jpeg"); 42 | mImageList.add("https://static.baydn.com/media/media_store/image/b0e3ab329c8d8218d2af5c8dfdc21125.jpg"); 43 | mImageList.add("https://static.baydn.com/media/media_store/image/670abb28408a9a0fc3dd9666e5ca1584.jpeg"); 44 | mImageList.add("https://static.baydn.com/media/media_store/image/1e8d675468ab61f4e5bdebd4bcb5f007.jpeg"); 45 | mImageList.add("https://static.baydn.com/media/media_store/image/9b2f93cbfa104dae1e67f540ff14a4c2.jpg"); 46 | mImageList.add("https://static.baydn.com/media/media_store/image/f5e0631e00a09edbbf2eb21eb71b4d3c.jpeg"); 47 | } 48 | 49 | @Nullable 50 | @Override 51 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 52 | View rootView = inflater.inflate(R.layout.fragment_loadimage, container, false); 53 | mAdapter = new ImageHolderAdapter(getContext()); 54 | mLoadImageHelper = new LoadImageHelper(getContext()); 55 | mLoadImageHelper.setSwipeRefreshLayout((SwipeRefreshLayout) rootView.findViewById(R.id.fragment_loadimage_refreshlayout)); 56 | mLoadImageHelper.setRecyclerView((RecyclerView) rootView.findViewById(R.id.fragment_loadimage_rv)); 57 | mLoadImageHelper.setAdapter(mAdapter); 58 | return rootView; 59 | } 60 | 61 | @Override 62 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 63 | initData(); 64 | mLoadImageHelper.init(); 65 | mAdapter.setDataList(mImageList); 66 | } 67 | 68 | @Override 69 | public void loadImageSuccess() { 70 | 71 | } 72 | 73 | @Override 74 | public void loadImageFailed() { 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/NavigationFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AlertDialog; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseFragment; 12 | import com.wuzhanglao.niubi.utils.AppUtils; 13 | 14 | /** 15 | * Created by wuming on 2016/12/2. 16 | */ 17 | 18 | public class NavigationFragment extends BaseFragment implements View.OnClickListener { 19 | 20 | @Nullable 21 | @Override 22 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 23 | View rootView = inflater.inflate(R.layout.fragment_navigation, container, false); 24 | rootView.findViewById(R.id.fragment_navi_checkupdate).setOnClickListener(this); 25 | rootView.findViewById(R.id.navi_fragment_contact).setOnClickListener(this); 26 | return rootView; 27 | } 28 | 29 | @Override 30 | public void onClick(View v) { 31 | switch (v.getId()) { 32 | case R.id.navi_fragment_contact: 33 | new AlertDialog.Builder(getContext()) 34 | .setTitle("个人主页") 35 | .setMessage("www.wuzhanglao.com") 36 | .setPositiveButton("确定", null).create().show(); 37 | break; 38 | case R.id.fragment_navi_checkupdate: 39 | AppUtils.showToast("该功能正在完善中..."); 40 | break; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/NetworkFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.mvp.presenter.NetworkFragmentPresenter; 12 | import com.wuzhanglao.niubi.mvp.view.NetworkFragmentView; 13 | import com.wuzhanglao.niubi.utils.AppUtils; 14 | 15 | /** 16 | * Created by wuming on 16/10/19. 17 | */ 18 | 19 | public class NetworkFragment extends BaseMvpFragment 20 | implements View.OnClickListener, NetworkFragmentView { 21 | 22 | private TextView result; 23 | 24 | @Nullable 25 | @Override 26 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 27 | View rootView = inflater.inflate(R.layout.fragment_network, container, false); 28 | result = (TextView) rootView.findViewById(R.id.fragment_network_result_tv); 29 | rootView.findViewById(R.id.fragment_network_get_btn).setOnClickListener(this); 30 | return rootView; 31 | } 32 | 33 | @Override 34 | public void onClick(View v) { 35 | switch (v.getId()) { 36 | case R.id.fragment_network_get_btn: 37 | presenter.request("北京"); 38 | break; 39 | } 40 | } 41 | 42 | @Override 43 | public NetworkFragmentPresenter initPresenter() { 44 | return new NetworkFragmentPresenter(); 45 | } 46 | 47 | 48 | @Override 49 | public void requestSuccess(Object obj) { 50 | AppUtils.showToast("请求成功"); 51 | } 52 | 53 | @Override 54 | public void requestFailed(String msg) { 55 | AppUtils.showToast("请求失败"); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/TBHeadlineFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | import com.wuzhanglao.niubi.mvp.model.HeadlineBean; 12 | import com.wuzhanglao.niubi.utils.AppUtils; 13 | import com.wuzhanglao.niubi.widget.TaobaoHeadline; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * Created by wuming on 16/10/16. 20 | */ 21 | 22 | public class TBHeadlineFragment extends BaseFragment { 23 | 24 | private TaobaoHeadline taobaoHeadline; 25 | 26 | @Nullable 27 | @Override 28 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 29 | View rootView = inflater.inflate(R.layout.fragment_taobao_headline,container,false); 30 | List data = new ArrayList<>(); 31 | data.add(new HeadlineBean("热门", "袜子裤子只要998~只要998~")); 32 | data.add(new HeadlineBean("推荐", "秋冬上心,韩流服饰,一折起")); 33 | data.add(new HeadlineBean("好货", "品牌二手车")); 34 | data.add(new HeadlineBean("省钱", "MadCatz MMO7 游戏鼠标键盘套装")); 35 | 36 | taobaoHeadline = (TaobaoHeadline) rootView.findViewById(R.id.fragment_taobao_headline_headline); 37 | taobaoHeadline.setData(data); 38 | taobaoHeadline.setHeadlineClickListener(new TaobaoHeadline.HeadlineClickListener() { 39 | @Override 40 | public void onHeadlineClick(HeadlineBean bean) { 41 | AppUtils.showToast(bean.getTitle() + ":" + bean.getContent()); 42 | } 43 | 44 | @Override 45 | public void onMoreClick() { 46 | AppUtils.showToast("更多"); 47 | } 48 | }); 49 | return rootView; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/TestMeasureLayoutFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseFragment; 11 | 12 | /** 13 | * Created by wuming on 2017/1/16. 14 | */ 15 | 16 | public class TestMeasureLayoutFragment extends BaseFragment { 17 | 18 | @Nullable 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 21 | return inflater.inflate(R.layout.fragment_test_measure_layout, container, false); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/TranslationFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | 3 | /** 4 | * Created by wuming on 2016/12/2. 5 | */ 6 | 7 | //public class TranslationFragment extends BaseMvpFragment 8 | // implements HighlightFragmentView { 9 | // 10 | // private static final String TAG = TranslationFragment.class.getSimpleName(); 11 | // private static final String s = " Any contributions, large or small, #$% 174major 1884 features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed."; 12 | // private ClickableTextView englishText; 13 | // private TranslationDialog translationDialog; 14 | // 15 | // @Nullable 16 | // @Override 17 | // public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 18 | // View rootView = inflater.inflate(R.layout.fragment_highlight,container,false); 19 | // englishText = (ClickableTextView) rootView.findViewById(R.id.fragment_highlight_text); 20 | // englishText.setText(s); 21 | // englishText.setHighlightTextClickListener(new ClickableTextView.HighLightTextClickListener() { 22 | // @Override 23 | // public void onHighlightTextClick(String text) { 24 | // translationDialog.showLoading(); 25 | // presenter.getTranslation(text); 26 | // } 27 | // }); 28 | // translationDialog = new TranslationDialog(getContext()); 29 | // return rootView; 30 | // } 31 | // 32 | // //获取翻译结果成功,展示查询结果 33 | // @Override 34 | // public void getTranslationSuccess(Object result) { 35 | // Log.d(TAG, result.toString()); 36 | // translationDialog.showTranslation((ShanbayResp) result); 37 | // } 38 | // 39 | // //获取翻译结果失败 40 | // @Override 41 | // public void getTranslationFailed() { 42 | // translationDialog.dismiss(); 43 | // if (NetworkUtil.isNetworkAvailable()) { 44 | // AppUtils.showToast("查询失败"); 45 | // } else { 46 | // AppUtils.showToast("请检查网络连接"); 47 | // } 48 | // } 49 | // 50 | // @Override 51 | // public HighlightFragmentPresenter initPresenter() { 52 | // return new HighlightFragmentPresenter(); 53 | // } 54 | // 55 | // 56 | //} 57 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/fragment/ViewPagerFragment.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.fragment; 2 | /* 3 | * date:2017/1/22 4 | * author:wuzhanglao 5 | * website:www.wuzhanglao.com 6 | */ 7 | 8 | import com.wuzhanglao.niubi.base.BaseFragment; 9 | 10 | public class ViewPagerFragment extends BaseFragment { 11 | } 12 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/holder/EmptyViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | 6 | /** 7 | * Created on 2016/9/29. 8 | */ 9 | 10 | public class EmptyViewHolder extends RecyclerView.ViewHolder { 11 | public EmptyViewHolder(View itemView) { 12 | super(itemView); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/holder/HeadlineHolder.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | 9 | 10 | /** 11 | * Created by wuming on 16/10/16. 12 | */ 13 | 14 | public class HeadlineHolder extends RecyclerView.ViewHolder { 15 | 16 | public TextView title; 17 | public TextView content; 18 | 19 | public HeadlineHolder(View itemView) { 20 | super(itemView); 21 | title = (TextView) itemView.findViewById(R.id.headline_title_tv); 22 | content = (TextView) itemView.findViewById(R.id.headline_content_tv); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/holder/ImageHolder.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import com.wuzhanglao.niubi.R; 9 | 10 | 11 | /** 12 | * Created by wuming on 2016/12/3. 13 | */ 14 | 15 | public class ImageHolder extends RecyclerView.ViewHolder { 16 | 17 | public TextView title_tv; 18 | public TextView subtitle_tv; 19 | public ImageView image_iv; 20 | public View line; 21 | 22 | public ImageHolder(View itemView) { 23 | super(itemView); 24 | title_tv = (TextView) itemView.findViewById(R.id.image_hoder_title_tv); 25 | subtitle_tv = (TextView) itemView.findViewById(R.id.image_hoder_subtitle_tv); 26 | image_iv = (ImageView) itemView.findViewById(R.id.image_hoder_image_iv); 27 | line = itemView.findViewById(R.id.image_holder_line); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/holder/TextHolder.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.holder; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | 9 | /** 10 | * Created by wuming on 16/10/13. 11 | */ 12 | 13 | public class TextHolder extends RecyclerView.ViewHolder { 14 | 15 | public TextView title_tv; 16 | public TextView subtitle_tv; 17 | public TextView num_tv; 18 | public View line; 19 | 20 | public TextHolder(View itemView) { 21 | super(itemView); 22 | num_tv = (TextView) itemView.findViewById(R.id.text_holder_num_tv); 23 | title_tv = (TextView) itemView.findViewById(R.id.text_holder_title_tv); 24 | subtitle_tv = (TextView) itemView.findViewById(R.id.text_holder_subtitle_tv); 25 | line = itemView.findViewById(R.id.text_holder_line); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/HomeActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.util.Log; 8 | import android.widget.Toast; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.DefaultToolbar; 12 | import com.wuzhanglao.niubi.utils.LogUtils; 13 | import com.wuzhanglao.niubi.utils.ToastUtil; 14 | import com.wuzhanglao.niubi.utils.UIUtils; 15 | 16 | public class HomeActivity extends TransparentStatusActivity { 17 | 18 | private HomeMvpPresenter mPresenter; 19 | 20 | @Override 21 | protected void onCreate(@Nullable Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_home); 24 | DefaultToolbar toolbar = new DefaultToolbar(this); 25 | toolbar.setmTvTitle("主界面"); 26 | toolbar.hideBackIcon(); 27 | 28 | mPresenter = new HomeMvpPresenter(); 29 | mPresenter.setView(new HomeMvpView(this)); 30 | mPresenter.setModel(new HomeMvpModel()); 31 | mPresenter.attach(); 32 | mPresenter.init(); 33 | 34 | Log.d("wuming inject","123123"); 35 | 36 | Toast.makeText(this,"哈哈哈",Toast.LENGTH_LONG).show(); 37 | } 38 | 39 | @Override 40 | public void onBackPressed() { 41 | if (!UIUtils.isDoubleClick(2000)) { 42 | ToastUtil.showInfo("双击退出"); 43 | return; 44 | } 45 | super.onBackPressed(); 46 | } 47 | 48 | @Override 49 | protected void onDestroy() { 50 | super.onDestroy(); 51 | mPresenter.detach(); 52 | } 53 | 54 | public static void launch(Activity activity) { 55 | Intent intent = new Intent(activity, HomeActivity.class); 56 | activity.startActivity(intent); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/HomeMvpModel.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import com.wuzhanglao.niubi.base.mvp.BaseMvpModel; 4 | 5 | /** 6 | * create by wuzhanglao at 2017/8/30 7 | */ 8 | 9 | public class HomeMvpModel extends BaseMvpModel { 10 | } 11 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/HomeMvpView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | /* 3 | * date:2017/2/17 4 | * author:wuzhanglao 5 | * website:www.wuzhanglao.com 6 | */ 7 | 8 | import android.support.v4.app.Fragment; 9 | import android.support.v4.app.FragmentManager; 10 | import android.support.v4.widget.DrawerLayout; 11 | import android.support.v7.widget.LinearLayoutManager; 12 | import android.support.v7.widget.RecyclerView; 13 | 14 | import com.wuzhanglao.niubi.R; 15 | import com.wuzhanglao.niubi.adapter.TextHolderAdatpter; 16 | import com.wuzhanglao.niubi.base.BaseActivity; 17 | import com.wuzhanglao.niubi.base.mvp.BaseMvpView; 18 | import com.wuzhanglao.niubi.bean.TextBean; 19 | import com.wuzhanglao.niubi.misc.DemoActivity; 20 | import com.wuzhanglao.niubi.view.ExoPlayerDemo; 21 | 22 | import java.util.List; 23 | 24 | public class HomeMvpView extends BaseMvpView { 25 | 26 | private TextHolderAdatpter mAdapter; 27 | private DrawerLayout mDrawerLayout; 28 | 29 | private FragmentManager mFragmentManager; 30 | 31 | public HomeMvpView(BaseActivity activity) { 32 | super(activity); 33 | mDrawerLayout = (DrawerLayout) getActivity().findViewById(R.id.activity_main_drawer); 34 | mFragmentManager = activity.getSupportFragmentManager(); 35 | } 36 | 37 | public void openFragment(Fragment fragment, String fragmentName) { 38 | mFragmentManager.beginTransaction() 39 | .replace(R.id.main_container, fragment) 40 | .addToBackStack(null) 41 | .commitAllowingStateLoss(); 42 | } 43 | 44 | public void setDataList(List dataList, TextHolderAdatpter.TextHolderClickListener listener) { 45 | mAdapter = new TextHolderAdatpter(getActivity()); 46 | mAdapter.setTextHolderClickListener(listener); 47 | mAdapter.setDataList(dataList); 48 | 49 | RecyclerView recyclerView = (RecyclerView) getActivity().findViewById(R.id.recycler_view); 50 | recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); 51 | recyclerView.setAdapter(mAdapter); 52 | } 53 | 54 | public void startDemoActivity() { 55 | DemoActivity.launch(getActivity(), new ExoPlayerDemo(getActivity())); 56 | } 57 | 58 | public interface Callback { 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/TestRxActivity1.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import android.content.Intent; 4 | import android.os.Build; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.view.View; 8 | import android.view.WindowManager; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseActivity; 12 | 13 | /* 14 | * Created by wuming on 2016/12/2. 15 | */ 16 | 17 | public class TestRxActivity1 extends BaseActivity { 18 | 19 | @Override 20 | protected void onCreate(@Nullable Bundle savedInstanceState) { 21 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 22 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 23 | } 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_test_rxbus1); 26 | 27 | findViewById(R.id.activity_rxbus1_btn).setOnClickListener(new View.OnClickListener() { 28 | @Override 29 | public void onClick(View v) { 30 | Intent intent = new Intent(TestRxActivity1.this, TestRxActivity2.class); 31 | startActivity(intent); 32 | } 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/TestRxActivity2.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.view.View; 7 | 8 | import com.google.gson.Gson; 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.BaseActivity; 11 | import com.wuzhanglao.niubi.bean.RxBusBean; 12 | import com.wuzhanglao.niubi.utils.AppUtils; 13 | import com.wuzhanglao.niubi.utils.RxBus; 14 | 15 | import java.util.Random; 16 | 17 | /* 18 | * Created by wuming on 2016/12/2. 19 | */ 20 | 21 | public class TestRxActivity2 extends BaseActivity { 22 | 23 | @Override 24 | protected void onCreate(@Nullable Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_test_rxbus2); 27 | 28 | findViewById(R.id.activity_rxbus2_btn).setOnClickListener(new View.OnClickListener() { 29 | 30 | @Override 31 | public void onClick(View v) { 32 | RxBusBean bean = new RxBusBean(); 33 | bean.setFrom("MainActivity2"); 34 | bean.setTo("MainActivity1"); 35 | bean.setContent(new Random().nextInt() + ""); 36 | Gson gson = new Gson(); 37 | RxBus.send(gson.toJson(bean)); 38 | AppUtils.showToast("消息发送成功,消息内容是:" + bean.getContent()); 39 | } 40 | }); 41 | findViewById(R.id.jump).setOnClickListener(new View.OnClickListener() { 42 | @Override 43 | public void onClick(View v) { 44 | Intent intent = new Intent(TestRxActivity2.this, ThirdActivity.class); 45 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); 46 | startActivity(intent); 47 | } 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/ThirdActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | 9 | /* 10 | * date:2017/2/6 11 | * author:wuzhanglao 12 | * website:www.wuzhanglao.com 13 | */ 14 | 15 | public class ThirdActivity extends AppCompatActivity { 16 | @Override 17 | protected void onCreate(@Nullable Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_third); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/home/TransparentStatusActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.home; 2 | 3 | import android.graphics.Color; 4 | import android.os.Build; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.view.WindowManager; 8 | 9 | import com.wuzhanglao.niubi.base.BaseActivity; 10 | 11 | /** 12 | * Created by ming.wu@shanbay.com on 2017/5/7. 13 | */ 14 | 15 | public abstract class TransparentStatusActivity extends BaseActivity { 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 19 | //全透明状态栏(不带阴影) 20 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); 21 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); 22 | getWindow().setStatusBarColor(Color.TRANSPARENT); 23 | } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 24 | //半透明状态栏(带阴影) 25 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 26 | } 27 | super.onCreate(savedInstanceState); 28 | } 29 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/misc/DemoActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.misc; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | import com.wuzhanglao.niubi.base.DefaultToolbar; 11 | import com.wuzhanglao.niubi.home.TransparentStatusActivity; 12 | import com.wuzhanglao.niubi.utils.ToastUtil; 13 | 14 | /** 15 | * Created by ming.wu@shanbay.com on 2017/6/15. 16 | */ 17 | 18 | public class DemoActivity extends TransparentStatusActivity { 19 | 20 | private static DemoView sDemoView; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_demo); 26 | 27 | DefaultToolbar toolbar = new DefaultToolbar(this); 28 | toolbar.setmTvTitle(sDemoView.getTitle()); 29 | toolbar.showRightIcon(new View.OnClickListener() { 30 | @Override 31 | public void onClick(View v) { 32 | ToastUtil.showInfo("分享"); 33 | } 34 | }); 35 | 36 | ((ViewGroup) findViewById(R.id.demo_activity_root)).addView(sDemoView.getView()); 37 | } 38 | 39 | @Override 40 | protected void onDestroy() { 41 | super.onDestroy(); 42 | sDemoView = null; 43 | } 44 | 45 | public static void launch(Activity activity, DemoView demoView) { 46 | sDemoView = demoView; 47 | Intent intent = new Intent(activity, DemoActivity.class); 48 | activity.startActivity(intent); 49 | } 50 | 51 | public interface DemoView { 52 | View getView(); 53 | 54 | String getTitle(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/misc/RectCornerLayout.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.misc; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Color; 7 | import android.graphics.Paint; 8 | import android.graphics.RectF; 9 | import android.support.annotation.NonNull; 10 | import android.support.annotation.Nullable; 11 | import android.util.AttributeSet; 12 | import android.util.TypedValue; 13 | import android.widget.FrameLayout; 14 | 15 | import com.wuzhanglao.niubi.R; 16 | 17 | /** 18 | * Created by ming.wu@shanbay.com on 2017/6/26. 19 | */ 20 | 21 | public class RectCornerLayout extends FrameLayout { 22 | private static final int DEFAULT_COLOR = Color.LTGRAY; 23 | private static final int DEFAULT_RADIUS = 0; 24 | 25 | private RectF mRectF = new RectF(); 26 | private Paint mPaint = new Paint(); 27 | 28 | private int mCornerColor; 29 | private int mCornerRadius; 30 | 31 | public RectCornerLayout(@NonNull Context context) { 32 | this(context, null); 33 | } 34 | 35 | public RectCornerLayout(@NonNull Context context, @Nullable AttributeSet attrs) { 36 | super(context, attrs); 37 | 38 | TypedArray ta = getResources().obtainAttributes(attrs, R.styleable.cview_RectCornerLayout); 39 | mCornerColor = ta.getColor(R.styleable.cview_RectCornerLayout_cview_rectCornerColor, DEFAULT_COLOR); 40 | mCornerRadius = ta.getDimensionPixelSize(R.styleable.cview_RectCornerLayout_cview_rectCornerRadius, DEFAULT_RADIUS); 41 | ta.recycle(); 42 | 43 | mPaint = new Paint(); 44 | mPaint.setDither(true); 45 | mPaint.setAntiAlias(true); 46 | mPaint.setStrokeWidth(0); 47 | mPaint.setStyle(Paint.Style.FILL); 48 | mPaint.setColor(mCornerColor); 49 | 50 | setWillNotDraw(false); 51 | } 52 | 53 | @Override 54 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 55 | super.onSizeChanged(w, h, oldw, oldh); 56 | mRectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); 57 | } 58 | 59 | public void setCornerRadius(int dip) { 60 | Float value = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, getResources().getDisplayMetrics()); 61 | mCornerRadius = value.intValue(); 62 | invalidate(); 63 | } 64 | 65 | public void setCornerColor(int color) { 66 | mCornerColor = color; 67 | mPaint.setColor(mCornerColor); 68 | invalidate(); 69 | } 70 | 71 | @Override 72 | protected void onDraw(Canvas canvas) { 73 | canvas.drawRoundRect(mRectF, mCornerRadius, mCornerRadius, mPaint); 74 | super.onDraw(canvas); 75 | } 76 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/misc/RoundCornerLayout.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.misc; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Color; 7 | import android.graphics.Paint; 8 | import android.graphics.RectF; 9 | import android.support.annotation.NonNull; 10 | import android.support.annotation.Nullable; 11 | import android.util.AttributeSet; 12 | import android.widget.FrameLayout; 13 | 14 | import com.wuzhanglao.niubi.R; 15 | 16 | /** 17 | * Created by ming.wu@shanbay.com on 2017/6/26. 18 | */ 19 | 20 | public class RoundCornerLayout extends FrameLayout { 21 | private static final int DEFAULT_COLOR = Color.LTGRAY; 22 | 23 | private RectF mRectF = new RectF(); 24 | private Paint mPaint = new Paint(); 25 | 26 | private int mCornerColor; 27 | 28 | public RoundCornerLayout(@NonNull Context context) { 29 | this(context, null); 30 | } 31 | 32 | public RoundCornerLayout(@NonNull Context context, @Nullable AttributeSet attrs) { 33 | super(context, attrs); 34 | 35 | TypedArray ta = getResources().obtainAttributes(attrs, R.styleable.cview_RoundCornerLayout); 36 | mCornerColor = ta.getColor(R.styleable.cview_RoundCornerLayout_cview_roundCornerColor, DEFAULT_COLOR); 37 | ta.recycle(); 38 | 39 | mPaint = new Paint(); 40 | mPaint.setDither(true); 41 | mPaint.setAntiAlias(true); 42 | mPaint.setStrokeWidth(0); 43 | mPaint.setStyle(Paint.Style.FILL); 44 | mPaint.setColor(mCornerColor); 45 | 46 | setWillNotDraw(false); 47 | } 48 | 49 | @Override 50 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 51 | super.onSizeChanged(w, h, oldw, oldh); 52 | mRectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); 53 | } 54 | 55 | public void setCornerColor(int color) { 56 | mCornerColor = color; 57 | mPaint.setColor(mCornerColor); 58 | invalidate(); 59 | } 60 | 61 | @Override 62 | protected void onDraw(Canvas canvas) { 63 | float radius = mRectF.height() / 2.0f; 64 | canvas.drawRoundRect(mRectF, radius, radius, mPaint); 65 | super.onDraw(canvas); 66 | } 67 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/misc/SplashActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.misc; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.wuzhanglao.niubi.base.BaseActivity; 6 | import com.wuzhanglao.niubi.home.HomeActivity; 7 | 8 | /** 9 | * Created by ming.wu@shanbay.com on 2017/5/30. 10 | */ 11 | 12 | public class SplashActivity extends BaseActivity { 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right); 17 | HomeActivity.launch(SplashActivity.this); 18 | finish(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/misc/StartTempQQChatActivity.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.misc; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | import com.wuzhanglao.niubi.base.DefaultToolbar; 9 | import com.wuzhanglao.niubi.home.TransparentStatusActivity; 10 | 11 | /** 12 | * Created by ming.wu@shanbay.com on 2017/6/15. 13 | */ 14 | 15 | public class StartTempQQChatActivity extends TransparentStatusActivity { 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_start_temp_qq_chat); 21 | 22 | DefaultToolbar toolbar = new DefaultToolbar(this); 23 | toolbar.setmTvTitle("QQ临时对话"); 24 | 25 | String qq = getIntent().getDataString(); 26 | //mqqwpa://im/chat?chat_type=wpa&uin=910521727&version=1&src_type=web&web_src=qq.com 27 | String url = String.format("mqqwpa://im/chat?chat_type=wpa&uin=%s&version=1&src_type=web&web_src=qq.com",qq); 28 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/model/HeWeatherBean.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.model; 2 | 3 | /** 4 | * Created by wuming on 16/10/19. 5 | */ 6 | 7 | public class HeWeatherBean { 8 | 9 | 10 | /** 11 | * aqi : 71 12 | * co : 1 13 | * no2 : 75 14 | * o3 : 101 15 | * pm10 : 89 16 | * pm25 : 44 17 | * qlty : 良 18 | * so2 : 27 19 | */ 20 | 21 | private CityBean city; 22 | 23 | public CityBean getCity() { 24 | return city; 25 | } 26 | 27 | public void setCity(CityBean city) { 28 | this.city = city; 29 | } 30 | 31 | public static class CityBean { 32 | private String aqi; 33 | private String co; 34 | private String no2; 35 | private String o3; 36 | private String pm10; 37 | private String pm25; 38 | private String qlty; 39 | private String so2; 40 | 41 | public String getAqi() { 42 | return aqi; 43 | } 44 | 45 | public void setAqi(String aqi) { 46 | this.aqi = aqi; 47 | } 48 | 49 | public String getCo() { 50 | return co; 51 | } 52 | 53 | public void setCo(String co) { 54 | this.co = co; 55 | } 56 | 57 | public String getNo2() { 58 | return no2; 59 | } 60 | 61 | public void setNo2(String no2) { 62 | this.no2 = no2; 63 | } 64 | 65 | public String getO3() { 66 | return o3; 67 | } 68 | 69 | public void setO3(String o3) { 70 | this.o3 = o3; 71 | } 72 | 73 | public String getPm10() { 74 | return pm10; 75 | } 76 | 77 | public void setPm10(String pm10) { 78 | this.pm10 = pm10; 79 | } 80 | 81 | public String getPm25() { 82 | return pm25; 83 | } 84 | 85 | public void setPm25(String pm25) { 86 | this.pm25 = pm25; 87 | } 88 | 89 | public String getQlty() { 90 | return qlty; 91 | } 92 | 93 | public void setQlty(String qlty) { 94 | this.qlty = qlty; 95 | } 96 | 97 | public String getSo2() { 98 | return so2; 99 | } 100 | 101 | public void setSo2(String so2) { 102 | this.so2 = so2; 103 | } 104 | } 105 | 106 | @Override 107 | public String toString() { 108 | return "HeWeatherBean{" + 109 | "city=" + city + 110 | '}'; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/model/HeadlineBean.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.model; 2 | 3 | /** 4 | * Created by wuming on 16/10/16. 5 | */ 6 | 7 | public class HeadlineBean { 8 | private String title; 9 | private String content; 10 | 11 | public HeadlineBean() { 12 | } 13 | 14 | 15 | public HeadlineBean(String title, String content) { 16 | this.title = title; 17 | this.content = content; 18 | } 19 | 20 | public String getTitle() { 21 | return title; 22 | } 23 | 24 | public void setTitle(String title) { 25 | this.title = title; 26 | } 27 | 28 | public String getContent() { 29 | return content; 30 | } 31 | 32 | public void setContent(String content) { 33 | this.content = content; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "HeadlineBean{" + 39 | "title='" + title + '\'' + 40 | ", content='" + content + '\'' + 41 | '}'; 42 | } 43 | 44 | 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/presenter/ApproveListFragmentPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.presenter; 2 | 3 | 4 | import com.wuzhanglao.niubi.mvp.view.ApproveListFragmentView; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by wuming on 2016/10/23. 11 | */ 12 | 13 | public class ApproveListFragmentPresenter extends BaseMvpPresenter { 14 | public List getHeadList() { 15 | List urlList = new ArrayList<>(); 16 | urlList.add(""); 17 | return urlList; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/presenter/BaseMvpPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.presenter; 2 | 3 | import com.wuzhanglao.niubi.mvp.view.BaseMvpView; 4 | 5 | /** 6 | * Created by wuming on 16/10/20. 7 | */ 8 | 9 | public abstract class BaseMvpPresenter { 10 | 11 | V view; 12 | 13 | public void attachView(V view){ 14 | this.view = view; 15 | } 16 | 17 | public void detachView(){ 18 | view = null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/presenter/HighlightFragmentPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.presenter; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.wuzhanglao.niubi.mvp.model.ShanbayResp; 6 | import com.wuzhanglao.niubi.mvp.view.HighlightFragmentView; 7 | import com.wuzhanglao.niubi.utils.NetworkRequest; 8 | 9 | import rx.functions.Action1; 10 | 11 | public class HighlightFragmentPresenter extends BaseMvpPresenter { 12 | public void getTranslation(String word) { 13 | Action1 onNext = new Action1() { 14 | @Override 15 | public void call(ShanbayResp shanbayResp) { 16 | if (TextUtils.isEmpty(shanbayResp.getMsg())) { 17 | view.getTranslationFailed(); 18 | } else if (shanbayResp.getMsg().equals("SUCCESS")) { 19 | view.getTranslationSuccess(shanbayResp); 20 | } else { 21 | view.getTranslationFailed(); 22 | } 23 | } 24 | }; 25 | Action1 onError = new Action1() { 26 | @Override 27 | public void call(Throwable throwable) { 28 | view.getTranslationFailed(); 29 | } 30 | }; 31 | NetworkRequest.getInstance().getShanbayTranslation(word, onNext, onError); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/presenter/LoadImageFragmentPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.presenter; 2 | 3 | import com.wuzhanglao.niubi.mvp.view.LoadImageFragmentView; 4 | 5 | /** 6 | * Created by wuming on 2016/12/3. 7 | */ 8 | 9 | public class LoadImageFragmentPresenter extends BaseMvpPresenter { 10 | } 11 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/presenter/NetworkFragmentPresenter.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.presenter; 2 | 3 | import com.wuzhanglao.niubi.mvp.model.HeWeatherBean; 4 | import com.wuzhanglao.niubi.mvp.view.NetworkFragmentView; 5 | import com.wuzhanglao.niubi.utils.NetworkRequest; 6 | 7 | import rx.functions.Action1; 8 | 9 | /** 10 | * Created by wuming on 16/10/19. 11 | */ 12 | 13 | public class NetworkFragmentPresenter extends BaseMvpPresenter { 14 | 15 | public void request(String city) { 16 | Action1 onNext = new Action1() { 17 | @Override 18 | public void call(HeWeatherBean weather) { 19 | view.requestSuccess(weather); 20 | } 21 | }; 22 | NetworkRequest.getInstance().getWeather(city, onNext); 23 | } 24 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/view/ApproveListFragmentView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.view; 2 | 3 | /** 4 | * Created by wuming on 2016/10/23. 5 | */ 6 | 7 | public interface ApproveListFragmentView extends BaseMvpView { 8 | } 9 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/view/BaseMvpView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.view; 2 | 3 | /** 4 | * Created by wuming on 16/10/19. 5 | */ 6 | 7 | public interface BaseMvpView { 8 | } 9 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/view/HighlightFragmentView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.view; 2 | 3 | /** 4 | * Created by wuming on 2016/12/2. 5 | */ 6 | 7 | public interface HighlightFragmentView extends BaseMvpView { 8 | void getTranslationSuccess(Object result); 9 | 10 | void getTranslationFailed(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/view/LoadImageFragmentView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.view; 2 | 3 | /** 4 | * Created by wuming on 2016/12/3. 5 | */ 6 | 7 | public interface LoadImageFragmentView extends BaseMvpView { 8 | void loadImageSuccess(); 9 | void loadImageFailed(); 10 | } 11 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/mvp/view/NetworkFragmentView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.mvp.view; 2 | 3 | import com.wuzhanglao.niubi.mvp.view.BaseMvpView; 4 | 5 | /** 6 | * Created by wuming on 16/10/19. 7 | */ 8 | 9 | public interface NetworkFragmentView extends BaseMvpView { 10 | void requestSuccess(Object obj); 11 | void requestFailed(String msg); 12 | } 13 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/AppUtils.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | public class AppUtils { 4 | 5 | public static void showToast(String msg) { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/BitmapFileCache.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.Bitmap.CompressFormat; 5 | import android.graphics.BitmapFactory; 6 | 7 | import java.io.File; 8 | import java.io.FileNotFoundException; 9 | import java.io.FileOutputStream; 10 | import java.io.FilenameFilter; 11 | import java.io.IOException; 12 | 13 | public class BitmapFileCache { 14 | 15 | public static final String PATH = NoteApplication.getInstance().getExternalFilesDir("wuzhanglao").getAbsolutePath(); 16 | private File rootDir = new File(PATH); 17 | 18 | private BitmapFileCache() { 19 | // 如果Bitmap缓存文件夹不存在的话,就创建这个文件夹 20 | if (!rootDir.exists()) { 21 | rootDir.mkdir(); 22 | } 23 | } 24 | 25 | private static final class SingletonHolder { 26 | private static final BitmapFileCache instance = new BitmapFileCache(); 27 | } 28 | 29 | public static BitmapFileCache getInstance() { 30 | return SingletonHolder.instance; 31 | } 32 | 33 | public final void put(int hashCode, Bitmap bitmap) { 34 | try { 35 | FileOutputStream fos = new FileOutputStream(new File(rootDir, hashCode + ".jpg")); 36 | bitmap.compress(CompressFormat.JPEG, 100, fos); 37 | fos.flush(); 38 | fos.close(); 39 | } catch (FileNotFoundException e) { 40 | e.printStackTrace(); 41 | } catch (IOException e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | 46 | /** 47 | * 根据文件名获取Bitmap 48 | **/ 49 | public final Bitmap get(int hashCode, int defaultImgId) { 50 | String[] files = rootDir.list(new MyFilenameFilter(hashCode)); 51 | if (files == null || files.length == 0) { 52 | return null; 53 | } else { 54 | final Bitmap bitmap = BitmapFactory.decodeFile(PATH + "/" + files[0]); 55 | if (bitmap != null) { 56 | return bitmap; 57 | } else { 58 | return BitmapFactory.decodeResource(NoteApplication.getInstance().getResources(), defaultImgId); 59 | } 60 | } 61 | } 62 | 63 | public final Bitmap get(int hashCode) { 64 | String[] files = rootDir.list(new MyFilenameFilter(hashCode)); 65 | if (files == null || files.length == 0) { 66 | return null; 67 | } else { 68 | final Bitmap bitmap = BitmapFactory.decodeFile(PATH + "/" + files[0]); 69 | if (bitmap != null) { 70 | return bitmap; 71 | } else { 72 | return null; 73 | } 74 | } 75 | } 76 | 77 | /** 78 | * 文件名过滤器,把想要的文件过滤出来 79 | **/ 80 | private final class MyFilenameFilter implements FilenameFilter { 81 | 82 | private int hashCode; 83 | 84 | public MyFilenameFilter(int hashCode) { 85 | this.hashCode = hashCode; 86 | } 87 | 88 | @Override 89 | public boolean accept(File dir, String filename) { 90 | return filename.equals(hashCode + ".jpg"); 91 | } 92 | 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/GlobleConfig.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | /** 4 | * Created by wuming on 16/10/19. 5 | */ 6 | 7 | public class GlobleConfig { 8 | //和风天气AK 9 | public static final String HEFENG_KEY = "7e98176448394ae89cb4046842208fd1"; 10 | } 11 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/ITest.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by wuming on 2018/3/22. 7 | */ 8 | 9 | public class ITest { 10 | 11 | private void outerMethod() { 12 | Log.d("TAG", "outer"); 13 | } 14 | 15 | private class InnerClass { 16 | private void innerMethod() { 17 | Log.d("TAG", "inner"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by wuming on 2018/3/22. 7 | */ 8 | 9 | public class LogUtils { 10 | 11 | public String bbb; 12 | public int viewType = 7; 13 | public String aaa; 14 | 15 | public static void prtLog(String msg) { 16 | Log.d("inject log", msg); 17 | } 18 | 19 | public static int getInt() { 20 | return 0; 21 | } 22 | 23 | public static Integer getInteger() { 24 | return 0; 25 | } 26 | 27 | public static boolean getBool() { 28 | return false; 29 | } 30 | 31 | public static Boolean getBoolean() { 32 | return false; 33 | } 34 | 35 | public static String getString() { 36 | return ""; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/NetworkRequest.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | 4 | import com.wuzhanglao.niubi.mvp.model.HeWeatherBean; 5 | import com.wuzhanglao.niubi.mvp.model.ShanbayResp; 6 | 7 | import rx.Observable; 8 | import rx.android.schedulers.AndroidSchedulers; 9 | import rx.functions.Action1; 10 | import rx.schedulers.Schedulers; 11 | 12 | /** 13 | * Created by wuming on 16/10/19. 14 | */ 15 | 16 | public class NetworkRequest { 17 | 18 | public static final NetworkRequest getInstance() { 19 | return SingletonHolder.instance; 20 | } 21 | 22 | private static final NetworkService getHeWeatherService() { 23 | return SingletonHolder.heweather_service; 24 | } 25 | 26 | private static final NetworkService getShanbayService() { 27 | return SingletonHolder.shanbay_service; 28 | } 29 | 30 | public void getWeather(String city, Action1 onNext) { 31 | getHeWeatherService().getWeatherService(city, GlobleConfig.HEFENG_KEY).compose(new ComposeThread()).subscribe(onNext); 32 | } 33 | 34 | public void getScenic(String cityid, Action1 onNext) { 35 | getHeWeatherService().getScenicService(cityid, GlobleConfig.HEFENG_KEY).compose(new ComposeThread()).subscribe(onNext); 36 | } 37 | 38 | public void getShanbayTranslation(String word, Action1 onNext, Action1 onError) { 39 | getShanbayService().getTranslation(word).compose(new ComposeThread()).subscribe(onNext, onError); 40 | } 41 | 42 | private static class SingletonHolder { 43 | private static final NetworkRequest instance = new NetworkRequest(); 44 | private static final NetworkService heweather_service = NetworkService.Factory.create(NetworkService.BASE_URL_HeWeather); 45 | private static final NetworkService shanbay_service = NetworkService.Factory.create(NetworkService.BASE_URL_SHANBAY); 46 | } 47 | 48 | private class ComposeThread implements Observable.Transformer { 49 | @Override 50 | public Observable call(Observable observable) { 51 | return observable 52 | .subscribeOn(Schedulers.io()) 53 | .unsubscribeOn(Schedulers.io()) 54 | .observeOn(AndroidSchedulers.mainThread()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/NetworkService.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import com.wuzhanglao.niubi.mvp.model.HeWeatherBean; 4 | import com.wuzhanglao.niubi.mvp.model.ShanbayResp; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.util.concurrent.TimeUnit; 9 | 10 | import okhttp3.Cache; 11 | import okhttp3.Interceptor; 12 | import okhttp3.OkHttpClient; 13 | import okhttp3.Request; 14 | import okhttp3.Response; 15 | import okhttp3.logging.HttpLoggingInterceptor; 16 | import retrofit2.Retrofit; 17 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 18 | import retrofit2.converter.gson.GsonConverterFactory; 19 | import retrofit2.http.GET; 20 | import retrofit2.http.Query; 21 | import rx.Observable; 22 | 23 | /** 24 | * 包含了一系列的网络请求接口 25 | * Created by wuming on 16/10/19. 26 | */ 27 | 28 | public interface NetworkService { 29 | 30 | String CACHE_PATH = "okhttp_cache"; 31 | String BASE_URL_HeWeather = "https://api.heweather.com"; 32 | String BASE_URL_SHANBAY = "https://api.shanbay.com/"; 33 | 34 | class Factory { 35 | public static final NetworkService create(String baseUrl) { 36 | HttpLoggingInterceptor logInterceptor = new HttpLoggingInterceptor(); 37 | logInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); 38 | OkHttpClient client = new OkHttpClient.Builder() 39 | .addInterceptor(logInterceptor)//日志拦截器 40 | .addNetworkInterceptor(new CacheInterceptor()) 41 | .connectTimeout(15, TimeUnit.SECONDS)//设置连接超时 42 | .retryOnConnectionFailure(true) 43 | .cache(new Cache(new File(NoteApplication.getInstance().getCacheDir(), CACHE_PATH), 1024 * 1024 * 10)) 44 | .build(); 45 | Retrofit retrofit = new Retrofit.Builder() 46 | .baseUrl(baseUrl) 47 | .addConverterFactory(GsonConverterFactory.create())//json数据转换 48 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create())//将Callable接口转换成Observable接口 49 | .client(client)//网络请求客户端为okhttp 50 | .build(); 51 | return retrofit.create(NetworkService.class); 52 | } 53 | } 54 | 55 | class CacheInterceptor implements Interceptor { 56 | 57 | @Override 58 | public Response intercept(Chain chain) throws IOException { 59 | //可以进行网络重连接等操作 60 | //@link 这篇博客写的很详细:http://www.jianshu.com/p/faa46bbe8a2e 61 | Request request = chain.request(); 62 | Response response = chain.proceed(request); 63 | if (NetworkUtil.isNetworkAvailable()) { 64 | // 有网络时 设置缓存超时时间0个小时 65 | response.newBuilder() 66 | .header("Cache-Control", "public, max-age=" + 0) 67 | .build(); 68 | } else { 69 | response.newBuilder() 70 | .header("Cache-Control", "public, only-if-cached, max-stale=" + 60 * 60 * 24) 71 | .build(); 72 | } 73 | return response; 74 | } 75 | } 76 | 77 | @GET("x3/weather") 78 | Observable getWeatherService(@Query("city") String city, @Query("key") String key); 79 | 80 | @GET("x3/attractions") 81 | Observable getScenicService(@Query("cityid") String cityid, @Query("key") String key); 82 | 83 | @GET("bdc/search") 84 | Observable getTranslation(@Query("word") String word); 85 | } 86 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/NetworkUtil.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | 7 | /** 8 | * Created by wuming on 2016/12/6. 9 | */ 10 | 11 | public class NetworkUtil { 12 | /** 13 | * 检测网络是否连接 14 | * 15 | * @return 16 | */ 17 | public static boolean isNetworkAvailable() { 18 | boolean flag = false; 19 | final ConnectivityManager manager = (ConnectivityManager) NoteApplication.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE); 20 | //去进行判断网络是否连接 21 | if (manager.getActiveNetworkInfo() != null) { 22 | flag = manager.getActiveNetworkInfo().isAvailable(); 23 | } 24 | return flag; 25 | } 26 | 27 | /** 28 | * 网络已经连接,然后去判断是wifi连接还是GPRS连接 29 | */ 30 | public static String getNetworkType() { 31 | final ConnectivityManager manager = (ConnectivityManager) NoteApplication.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE); 32 | NetworkInfo.State gprs = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState(); 33 | NetworkInfo.State wifi = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState(); 34 | if (gprs == NetworkInfo.State.CONNECTED || gprs == NetworkInfo.State.CONNECTING) { 35 | return "GPRS"; 36 | } 37 | //判断为wifi状态下才加载广告,如果是GPRS手机网络则不加载! 38 | if (wifi == NetworkInfo.State.CONNECTED || wifi == NetworkInfo.State.CONNECTING) { 39 | return "WIFI"; 40 | } 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/NoteApplication.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.app.Application; 4 | 5 | /** 6 | * Created by wuming on 16/10/13. 7 | */ 8 | 9 | public class NoteApplication extends Application { 10 | private static NoteApplication instance; 11 | 12 | @Override 13 | public void onCreate() { 14 | super.onCreate(); 15 | instance = this; 16 | } 17 | 18 | public static NoteApplication getInstance() { 19 | return instance; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/RxBus.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import rx.Observable; 4 | import rx.subjects.PublishSubject; 5 | import rx.subjects.SerializedSubject; 6 | import rx.subjects.Subject; 7 | 8 | /** 9 | * Created by wuming on 2016/11/22. 10 | */ 11 | 12 | //单例模式的一种写法 13 | public enum RxBus { 14 | INSTANCE; 15 | 16 | private Subject mRxBusObserverable = new SerializedSubject<>(PublishSubject.create()); 17 | 18 | public static void send(Object object) { 19 | if (INSTANCE.mRxBusObserverable.hasObservers()) { 20 | INSTANCE.mRxBusObserverable.onNext(object); 21 | } 22 | } 23 | 24 | public static Observable toObserverable() { 25 | return INSTANCE.mRxBusObserverable; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/ToastUtil.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.RectF; 8 | import android.os.Looper; 9 | import android.support.annotation.NonNull; 10 | import android.util.TypedValue; 11 | import android.view.Gravity; 12 | import android.widget.FrameLayout; 13 | import android.widget.TextView; 14 | import android.widget.Toast; 15 | 16 | /** 17 | * create by wuzhanglao at 2017/6/10 18 | */ 19 | 20 | public class ToastUtil { 21 | 22 | public static void showError(String msg) { 23 | if (Looper.myLooper() != Looper.getMainLooper()) { 24 | return; 25 | } 26 | ToastView toastView = new ToastView(NoteApplication.getInstance(), msg); 27 | toastView.setColor(Color.RED); 28 | Toast toast = new Toast(NoteApplication.getInstance()); 29 | toast.setView(toastView); 30 | toast.setDuration(Toast.LENGTH_SHORT); 31 | toast.show(); 32 | } 33 | 34 | public static void showInfo(String msg) { 35 | if (Looper.myLooper() != Looper.getMainLooper()) { 36 | return; 37 | } 38 | Toast toast = new Toast(NoteApplication.getInstance()); 39 | toast.setView(new ToastView(NoteApplication.getInstance(), msg)); 40 | toast.setDuration(Toast.LENGTH_SHORT); 41 | toast.show(); 42 | } 43 | 44 | private static class ToastView extends FrameLayout { 45 | 46 | private TextView mTextView; 47 | private float mRadius; 48 | private RectF mRectF = new RectF(); 49 | private Paint mPaint = new Paint(); 50 | 51 | public ToastView(@NonNull Context context, CharSequence msg) { 52 | super(context); 53 | mPaint = new Paint(); 54 | mPaint.setDither(true); 55 | mPaint.setAntiAlias(true); 56 | mPaint.setStrokeWidth(0); 57 | mPaint.setStyle(Paint.Style.FILL); 58 | mPaint.setColor(Color.GRAY); 59 | mPaint.setAlpha(230); 60 | 61 | mTextView = new TextView(context); 62 | mTextView.setText(msg); 63 | mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); 64 | addView(mTextView); 65 | FrameLayout.LayoutParams layoutParams = (LayoutParams) mTextView.getLayoutParams(); 66 | layoutParams.gravity = Gravity.CENTER; 67 | mTextView.setLayoutParams(layoutParams); 68 | mTextView.setTextColor(Color.WHITE); 69 | int padding_5_dp = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics())); 70 | int padding_10_dp = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics())); 71 | mTextView.setPadding(padding_10_dp, padding_5_dp, padding_10_dp, padding_5_dp); 72 | 73 | mRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics()); 74 | setWillNotDraw(false); 75 | } 76 | 77 | @Override 78 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 79 | super.onSizeChanged(w, h, oldw, oldh); 80 | mRectF.set(0, 0, mTextView.getMeasuredWidth(), mTextView.getMeasuredHeight()); 81 | } 82 | 83 | public void setColor(int color) { 84 | mPaint.setColor(color); 85 | invalidate(); 86 | } 87 | 88 | @Override 89 | protected void onDraw(Canvas canvas) { 90 | canvas.drawRoundRect(mRectF, mRadius, mRadius, mPaint); 91 | super.onDraw(canvas); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/UIUtils.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.utils; 2 | 3 | import android.util.TypedValue; 4 | 5 | /** 6 | * Created by wuming on 16/10/14. 7 | */ 8 | 9 | public class UIUtils { 10 | private static long lastClickTime; 11 | 12 | public static boolean isDoubleClick(int interval) { 13 | long currentClickTime = System.currentTimeMillis(); 14 | if ((currentClickTime - lastClickTime) > interval) { 15 | lastClickTime = currentClickTime; 16 | return false; 17 | } 18 | return true; 19 | } 20 | 21 | public static Float dp2px(float dipValue) { 22 | float value = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue, NoteApplication.getInstance().getResources().getDisplayMetrics()); 23 | return value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/nine_old_android/FloatProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.wuzhanglao.niubi.utils.nine_old_android; 17 | 18 | /** 19 | * An implementation of {@link android.util.Property} to be used specifically with fields of type 20 | * float. This type-specific subclass enables performance benefit by allowing 21 | * calls to a {@link #set(Object, Float) set()} function that takes the primitive 22 | * float type and avoids autoboxing and other overhead associated with the 23 | * Float class. 24 | * 25 | * @param The class on which the Property is declared. 26 | * 27 | * @hide 28 | */ 29 | public abstract class FloatProperty extends Property { 30 | 31 | public FloatProperty(String name) { 32 | super(Float.class, name); 33 | } 34 | 35 | /** 36 | * A type-specific override of the {@link #set(Object, Float)} that is faster when dealing 37 | * with fields of type float. 38 | */ 39 | public abstract void setValue(T object, float value); 40 | 41 | @Override 42 | final public void set(T object, Float value) { 43 | setValue(object, value); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/nine_old_android/IntProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.wuzhanglao.niubi.utils.nine_old_android; 17 | 18 | /** 19 | * An implementation of {@link android.util.Property} to be used specifically with fields of type 20 | * int. This type-specific subclass enables performance benefit by allowing 21 | * calls to a {@link #set(Object, Integer) set()} function that takes the primitive 22 | * int type and avoids autoboxing and other overhead associated with the 23 | * Integer class. 24 | * 25 | * @param The class on which the Property is declared. 26 | * 27 | * @hide 28 | */ 29 | public abstract class IntProperty extends Property { 30 | 31 | public IntProperty(String name) { 32 | super(Integer.class, name); 33 | } 34 | 35 | /** 36 | * A type-specific override of the {@link #set(Object, Integer)} that is faster when dealing 37 | * with fields of type int. 38 | */ 39 | public abstract void setValue(T object, int value); 40 | 41 | @Override 42 | final public void set(T object, Integer value) { 43 | set(object, value.intValue()); 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/nine_old_android/NoSuchPropertyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.wuzhanglao.niubi.utils.nine_old_android; 17 | 18 | /** 19 | * Thrown when code requests a {@link Property} on a class that does 20 | * not expose the appropriate method or field. 21 | * 22 | * @see Property#of(Class, Class, String) 23 | */ 24 | public class NoSuchPropertyException extends RuntimeException { 25 | 26 | public NoSuchPropertyException(String s) { 27 | super(s); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/transformer/CubeInTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.wuzhanglao.niubi.utils.transformer; 18 | 19 | import android.view.View; 20 | 21 | public class CubeInTransformer extends BaseTransformer { 22 | 23 | @Override 24 | protected void onTransform(View view, float position) { 25 | // Rotate the fragment on the left or right edge 26 | view.setPivotX(position > 0 ? 0 : view.getWidth()); 27 | view.setPivotY(0); 28 | view.setRotationY(-90f * position); 29 | } 30 | 31 | @Override 32 | public boolean isPagingEnabled() { 33 | return true; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/transformer/CubeOutTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.wuzhanglao.niubi.utils.transformer; 18 | 19 | import android.view.View; 20 | 21 | public class CubeOutTransformer extends BaseTransformer { 22 | 23 | @Override 24 | protected void onTransform(View view, float position) { 25 | view.setPivotX(position < 0f ? view.getWidth() : 0f); 26 | view.setPivotY(view.getHeight() * 0.5f); 27 | view.setRotationY(90f * position); 28 | } 29 | 30 | @Override 31 | public boolean isPagingEnabled() { 32 | return true; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/utils/transformer/RotateUpTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Toxic Bakery 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.wuzhanglao.niubi.utils.transformer; 18 | 19 | import android.view.View; 20 | 21 | public class RotateUpTransformer extends BaseTransformer { 22 | 23 | private static final float ROT_MOD = -15f; 24 | 25 | @Override 26 | protected void onTransform(View view, float position) { 27 | final float width = view.getWidth(); 28 | final float rotation = ROT_MOD * position; 29 | 30 | view.setPivotX(width * 0.5f); 31 | view.setPivotY(0f); 32 | view.setTranslationX(0f); 33 | view.setRotation(rotation); 34 | } 35 | 36 | @Override 37 | protected boolean isPagingEnabled() { 38 | return true; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/view/HorizontalProgressDemo.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.view; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | import android.view.Window; 6 | 7 | import com.wuzhanglao.niubi.R; 8 | import com.wuzhanglao.niubi.base.BaseActivity; 9 | import com.wuzhanglao.niubi.misc.DemoActivity; 10 | 11 | /** 12 | * Created by ming.wu@shanbay.com on 2017/6/15. 13 | */ 14 | 15 | public class HorizontalProgressDemo implements DemoActivity.DemoView { 16 | 17 | private View mRoot; 18 | private BaseActivity mActivity; 19 | 20 | public HorizontalProgressDemo(final BaseActivity activity) { 21 | mActivity = activity; 22 | mRoot = activity.getLayoutInflater().inflate(R.layout.layout_demo_horizontal_progress, (ViewGroup) activity.findViewById(Window.ID_ANDROID_CONTENT), false); 23 | } 24 | 25 | @Override 26 | public String getTitle() { 27 | return getClass().getSimpleName(); 28 | } 29 | 30 | @Override 31 | public View getView() { 32 | return mRoot; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/view/PatternDemo.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.view; 2 | 3 | import android.graphics.Color; 4 | import android.text.SpannableString; 5 | import android.text.style.ForegroundColorSpan; 6 | import android.util.Log; 7 | import android.view.View; 8 | import android.widget.TextView; 9 | 10 | import com.wuzhanglao.niubi.R; 11 | import com.wuzhanglao.niubi.base.BaseActivity; 12 | import com.wuzhanglao.niubi.misc.DemoActivity; 13 | 14 | import java.util.regex.Matcher; 15 | import java.util.regex.Pattern; 16 | 17 | /** 18 | * Created by ming.wu@shanbay.com on 2017/6/19. 19 | */ 20 | 21 | public class PatternDemo implements DemoActivity.DemoView { 22 | 23 | private View mRoot; 24 | 25 | public PatternDemo(BaseActivity activity) { 26 | mRoot = activity.getLayoutInflater().inflate(R.layout.layout_demo_pattern, null); 27 | 28 | // String regix =""; 29 | // Pattern pattern = Pattern.compile("shanbay.native.app://webview/feedback/input-box\\?action=(.+)&"); 30 | // Matcher matcher = pattern.matcher("shanbay.native.app://webview/feedback/input-box?action=open&feedback_id=rlhkz"); 31 | // if (matcher.find()) { 32 | // String group = matcher.group(0); 33 | // matcher.group(1); 34 | // } 35 | 36 | //(?i) 37 | 38 | SpannableString spannableString = new SpannableString("This Just to clear this up once and for all,this was not a mistake"); 39 | String regex = "((?i)this)"; 40 | Pattern pattern = Pattern.compile(regex); 41 | Matcher matcher = pattern.matcher("This Just to clear this up once and for all,this was not a mistake"); 42 | while (matcher.find()) { 43 | 44 | Log.d("123123123", "group->" + matcher.group() + " start->" + matcher.start() + " end->" + matcher.end()); 45 | ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.RED); 46 | spannableString.setSpan(foregroundColorSpan, matcher.start(), matcher.end(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); 47 | 48 | } 49 | 50 | TextView textView = (TextView) mRoot.findViewById(R.id.text); 51 | textView.setText(spannableString); 52 | 53 | } 54 | 55 | @Override 56 | public View getView() { 57 | return mRoot; 58 | } 59 | 60 | @Override 61 | public String getTitle() { 62 | return "正则表达式匹配"; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/ArrowView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.util.AttributeSet; 9 | import android.view.View; 10 | 11 | /** 12 | * date:2017/5/21 13 | * author:wuzhanglao 14 | * website:www.wuzhanglao.com 15 | */ 16 | 17 | public class ArrowView extends View { 18 | 19 | private Paint mPaint; 20 | 21 | private Path mPath = new Path(); 22 | 23 | public ArrowView(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public ArrowView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | mPaint = new Paint(); 30 | mPaint.setColor(Color.RED); 31 | mPaint.setAntiAlias(true); 32 | mPaint.setDither(true); 33 | mPaint.setStrokeWidth(5); 34 | mPaint.setStyle(Paint.Style.FILL_AND_STROKE); 35 | } 36 | 37 | @Override 38 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 39 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 40 | } 41 | 42 | @Override 43 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { 44 | super.onLayout(changed, left, top, right, bottom); 45 | } 46 | 47 | @Override 48 | protected void onDraw(Canvas canvas) { 49 | // 1.rotate the canvas 50 | canvas.rotate(50); 51 | // 1.1 caculate the angle 52 | 53 | // 2.draw line 54 | 55 | // 3.draw traiangle 56 | 57 | // 4.finish the paint 58 | 59 | Path path = new Path(); 60 | path.moveTo(0, getMeasuredHeight() / 2.0f); 61 | path.lineTo(getMeasuredWidth(), getMeasuredHeight() / 2.0f); 62 | canvas.drawPath(path, mPaint); 63 | 64 | Path path1 = new Path(); 65 | path.moveTo(getMeasuredWidth(), getMeasuredHeight() / 2.0f); 66 | path.lineTo(getMeasuredWidth() - 100, getMeasuredHeight() / 2.0f - 50); 67 | path.lineTo(getMeasuredWidth() - 100, getMeasuredHeight() / 2.0f + 50); 68 | path.close(); 69 | canvas.drawPath(path1, mPaint); 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/BiliBiliBarrage.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.animation.Animator; 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | import android.view.View; 7 | import android.widget.RelativeLayout; 8 | import android.widget.TextView; 9 | 10 | import java.util.Vector; 11 | 12 | /** 13 | * Created by wuming on 2016/11/28. 14 | */ 15 | 16 | public class BiliBiliBarrage extends RelativeLayout { 17 | 18 | private Vector subtitles = new Vector<>(); 19 | 20 | public BiliBiliBarrage(Context context) { 21 | super(context); 22 | } 23 | 24 | public BiliBiliBarrage(Context context, AttributeSet attrs) { 25 | super(context, attrs); 26 | //父布局的onDraw()方法会被执行 27 | setWillNotDraw(false); 28 | } 29 | 30 | public void addText(String subtitle) { 31 | TextView text = new TextView(getContext()); 32 | text.setText(subtitle); 33 | subtitles.add(text); 34 | } 35 | 36 | private final class MyAnimatorListener implements Animator.AnimatorListener { 37 | 38 | private View view; 39 | 40 | public MyAnimatorListener(View view) { 41 | this.view = view; 42 | } 43 | 44 | @Override 45 | public void onAnimationStart(Animator animation) { 46 | 47 | } 48 | 49 | @Override 50 | public void onAnimationEnd(Animator animation) { 51 | removeView(view); 52 | subtitles.remove(view); 53 | view = null; 54 | } 55 | 56 | @Override 57 | public void onAnimationCancel(Animator animation) { 58 | 59 | } 60 | 61 | @Override 62 | public void onAnimationRepeat(Animator animation) { 63 | 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/BottomBar.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.LayoutInflater; 6 | import android.widget.RelativeLayout; 7 | import android.widget.TextView; 8 | 9 | import com.wuzhanglao.niubi.R; 10 | 11 | /** 12 | * 仿QQ,微信底部icon,可以显示未读消息数角标 13 | * Created on 2016/10/11. 14 | */ 15 | 16 | public class BottomBar extends RelativeLayout { 17 | 18 | private Context context; 19 | private TextView bar_num; 20 | private int count = 0; 21 | 22 | public BottomBar(Context context) { 23 | this(context, null); 24 | } 25 | 26 | public BottomBar(Context context, AttributeSet attrs) { 27 | this(context, attrs, 0); 28 | } 29 | 30 | public BottomBar(Context context, AttributeSet attrs, int defStyleAttr) { 31 | super(context, attrs, defStyleAttr); 32 | this.context = context; 33 | RelativeLayout rl = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.bottom_bar_view, this, true); 34 | bar_num = (TextView) rl.findViewById(R.id.bar_num); 35 | bar_num.setVisibility(GONE); 36 | } 37 | 38 | public void add() { 39 | bar_num.setVisibility(VISIBLE); 40 | count++; 41 | if (count < 100) { 42 | bar_num.setText(count + ""); 43 | } else { 44 | bar_num.setText("99+"); 45 | } 46 | } 47 | 48 | public void add(int n) throws Exception { 49 | if(n<0){ 50 | throw new Exception(BottomBar.class.getSimpleName()+" add(int n).The param must be a positive num"); 51 | } 52 | bar_num.setVisibility(VISIBLE); 53 | count += n; 54 | if (count < 100) { 55 | bar_num.setText(count + ""); 56 | } else { 57 | bar_num.setText("99+"); 58 | } 59 | } 60 | 61 | public void delete() { 62 | if (count == 0) { 63 | bar_num.setVisibility(GONE); 64 | } else { 65 | count--; 66 | if (count == 0) { 67 | bar_num.setVisibility(GONE); 68 | } else if (count > 0 && count < 100) { 69 | bar_num.setVisibility(VISIBLE); 70 | bar_num.setText(count + ""); 71 | } else { 72 | bar_num.setVisibility(VISIBLE); 73 | bar_num.setText("99+"); 74 | } 75 | } 76 | } 77 | 78 | public void deleteAll() { 79 | count = 0; 80 | bar_num.setVisibility(GONE); 81 | } 82 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/CustomClock.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.graphics.Canvas; 6 | import android.graphics.Color; 7 | import android.graphics.Paint; 8 | import android.os.Build; 9 | import android.util.AttributeSet; 10 | import android.view.View; 11 | 12 | /** 13 | * 自定义钟表表盘 14 | * Created by wuming on 16/9/28. 15 | */ 16 | public class CustomClock extends View { 17 | 18 | private static final String TAG = "CustomClock"; 19 | 20 | private Paint paint; 21 | private float textHeight; 22 | 23 | public CustomClock(Context context) { 24 | this(context, null); 25 | } 26 | 27 | public CustomClock(Context context, AttributeSet attrs) { 28 | this(context, attrs, 0); 29 | } 30 | 31 | public CustomClock(Context context, AttributeSet attrs, int defStyleAttr) { 32 | super(context, attrs, defStyleAttr); 33 | init(); 34 | } 35 | 36 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 37 | public CustomClock(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 38 | super(context, attrs, defStyleAttr, defStyleRes); 39 | init(); 40 | } 41 | 42 | @Override 43 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 44 | int width = MeasureSpec.getSize(widthMeasureSpec); 45 | int width_mode = MeasureSpec.getMode(widthMeasureSpec); 46 | int height = MeasureSpec.getSize(heightMeasureSpec); 47 | int height_mode = MeasureSpec.getMode(heightMeasureSpec); 48 | if (width_mode == MeasureSpec.AT_MOST) { 49 | width = 400; 50 | } 51 | if (height_mode == MeasureSpec.AT_MOST) { 52 | height = 400; 53 | } 54 | setMeasuredDimension(width, height); 55 | } 56 | 57 | private void init() { 58 | paint = new Paint(); 59 | paint.setAntiAlias(true); 60 | paint.setDither(true); 61 | paint.setTextSize(15); 62 | paint.setStrokeWidth(2); 63 | paint.setColor(Color.BLACK); 64 | paint.setStyle(Paint.Style.STROKE); 65 | textHeight = paint.getFontMetrics().descent - paint.getFontMetrics().ascent; 66 | } 67 | 68 | @Override 69 | protected void onDraw(Canvas canvas) { 70 | int width = getWidth(); 71 | int height = getHeight(); 72 | int radius = Math.min(width, height) / 2; 73 | canvas.drawCircle(width / 2, height / 2, radius, paint); 74 | for (int i = 1; i <= 12; i++) { 75 | canvas.rotate(30, width / 2, height / 2); 76 | canvas.drawLine(width / 2, height / 2 - radius, width / 2, height / 2 - radius + 15, paint); 77 | canvas.drawText(i + "", width / 2 - paint.measureText(i + "") / 2, height / 2 - radius + 15 + textHeight, paint); 78 | } 79 | 80 | canvas.rotate(-30, width / 2, height / 2); 81 | paint.setColor(Color.BLACK); 82 | canvas.drawLine(width / 2, width / 2, height / 2, width / 2, paint); 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/GuaGuaKa.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.graphics.Canvas; 7 | import android.graphics.Color; 8 | import android.graphics.Paint; 9 | import android.graphics.Path; 10 | import android.graphics.PorterDuff; 11 | import android.graphics.PorterDuffXfermode; 12 | import android.graphics.Rect; 13 | import android.util.AttributeSet; 14 | import android.view.MotionEvent; 15 | import android.view.View; 16 | 17 | import com.wuzhanglao.niubi.R; 18 | 19 | /** 20 | * Created by wuming on 2016/11/6. 21 | */ 22 | 23 | public class GuaGuaKa extends View { 24 | 25 | private Paint pathPaint; 26 | private Path path; 27 | private Bitmap cacheBitmap; 28 | private Canvas cacheCanvas; 29 | private Rect srcRect; 30 | private Rect destRect; 31 | 32 | private Bitmap backBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.avatar); 33 | 34 | public GuaGuaKa(Context context) { 35 | this(context, null); 36 | } 37 | 38 | public GuaGuaKa(Context context, AttributeSet attrs) { 39 | super(context, attrs); 40 | this.setBackgroundColor(Color.WHITE); 41 | pathPaint = new Paint(); 42 | pathPaint.setAntiAlias(true); 43 | pathPaint.setDither(true); 44 | pathPaint.setColor(Color.BLACK); 45 | pathPaint.setStyle(Paint.Style.STROKE); 46 | pathPaint.setStrokeWidth(50); 47 | pathPaint.setStrokeCap(Paint.Cap.ROUND); 48 | pathPaint.setStrokeJoin(Paint.Join.ROUND); 49 | path = new Path(); 50 | } 51 | 52 | @Override 53 | protected void onDraw(Canvas canvas) { 54 | canvas.drawBitmap(backBitmap, 0, 0, null); 55 | pathPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT)); 56 | cacheCanvas.drawPath(path, pathPaint); 57 | canvas.drawBitmap(cacheBitmap, 0, 0, null); 58 | } 59 | 60 | @Override 61 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 62 | super.onSizeChanged(w, h, oldw, oldh); 63 | backBitmap = Bitmap.createScaledBitmap(backBitmap, getMeasuredWidth(), getMeasuredHeight(), true); 64 | } 65 | 66 | @Override 67 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) { 68 | super.onLayout(changed, left, top, right, bottom); 69 | cacheBitmap = Bitmap.createBitmap(getWidth() - getPaddingLeft() - getPaddingRight(), getHeight() - getPaddingTop() - getPaddingBottom(), Bitmap.Config.ARGB_8888); 70 | cacheCanvas = new Canvas(cacheBitmap); 71 | cacheCanvas.drawColor(Color.GRAY); 72 | } 73 | 74 | //手指按下时对应的x坐标和y坐标 75 | private float pointerX; 76 | private float pointerY; 77 | 78 | @Override 79 | public boolean onTouchEvent(MotionEvent event) { 80 | switch (event.getAction()) { 81 | case MotionEvent.ACTION_DOWN: 82 | pointerX = event.getX(); 83 | pointerY = event.getY(); 84 | path.moveTo(pointerX, pointerY); 85 | break; 86 | case MotionEvent.ACTION_MOVE: 87 | path.lineTo(event.getX(), event.getY()); 88 | pointerX = event.getX(); 89 | pointerY = event.getY(); 90 | break; 91 | } 92 | invalidate(); 93 | return true; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/IndicatorDialog.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.content.DialogInterface; 6 | import android.support.annotation.NonNull; 7 | import android.view.Window; 8 | import android.view.WindowManager; 9 | 10 | /* 11 | * Created by ming.wu@shanbay.com on 2017/4/9. 12 | */ 13 | 14 | public class IndicatorDialog extends Dialog implements DialogInterface.OnDismissListener { 15 | 16 | private Activity mActivity; 17 | 18 | public IndicatorDialog(@NonNull Activity activity) { 19 | super(activity); 20 | 21 | Window window = this.getWindow(); 22 | WindowManager.LayoutParams lp = window.getAttributes(); 23 | lp.width = WindowManager.LayoutParams.MATCH_PARENT; 24 | lp.height = WindowManager.LayoutParams.WRAP_CONTENT; 25 | window.setAttributes(lp); 26 | 27 | setContentView(null); 28 | setOnDismissListener(this); 29 | setCancelable(true); 30 | setCanceledOnTouchOutside(false); 31 | } 32 | 33 | @Override 34 | public void onDismiss(DialogInterface dialog) { 35 | mActivity.finish(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/NumberTipView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.util.AttributeSet; 8 | 9 | /* 10 | * Created by ming.wu@shanbay.com on 2017/1/25. 11 | */ 12 | public class NumberTipView extends android.support.v7.widget.AppCompatTextView { 13 | 14 | private Paint mPaint = new Paint(); 15 | 16 | public NumberTipView(Context context) { 17 | this(context, null); 18 | } 19 | 20 | public NumberTipView(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | mPaint.setDither(true); 23 | mPaint.setAntiAlias(true); 24 | mPaint.setFilterBitmap(true); 25 | mPaint.setStyle(Paint.Style.FILL); 26 | mPaint.setColor(Color.RED); 27 | setTextColor(Color.WHITE); 28 | } 29 | 30 | @Override 31 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 32 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 33 | if (getText().toString().isEmpty() || getText().toString().equals("0")) { 34 | setMeasuredDimension( 35 | MeasureSpec.makeMeasureSpec(0, MeasureSpec.EXACTLY), 36 | MeasureSpec.makeMeasureSpec(0, MeasureSpec.EXACTLY)); 37 | } 38 | } 39 | 40 | @Override 41 | protected void onDraw(Canvas canvas) { 42 | int width = getMeasuredWidth(); 43 | int height = getMeasuredHeight(); 44 | int min = Math.min(width, height); 45 | canvas.drawCircle(width / 2, height / 2, min / 2, mPaint); 46 | setBackground(null); 47 | super.onDraw(canvas); 48 | } 49 | 50 | public void setTipBackgroundColor(int color) { 51 | mPaint.setColor(color); 52 | invalidate(); 53 | } 54 | 55 | public void render(int num) { 56 | if (num >= 100) { 57 | setText("99+"); 58 | } else { 59 | setText(String.valueOf(num)); 60 | } 61 | requestLayout(); 62 | } 63 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/RippleView.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.animation.AnimatorSet; 4 | import android.animation.ObjectAnimator; 5 | import android.content.Context; 6 | import android.graphics.Canvas; 7 | import android.graphics.Color; 8 | import android.graphics.Paint; 9 | import android.support.annotation.Nullable; 10 | import android.util.AttributeSet; 11 | import android.view.View; 12 | 13 | /** 14 | * Created by wuming on 2017/10/27. 15 | */ 16 | 17 | public class RippleView extends View { 18 | 19 | private Paint mPaint = new Paint(); 20 | 21 | public RippleView(Context context) { 22 | this(context, null); 23 | } 24 | 25 | public RippleView(Context context, @Nullable AttributeSet attrs) { 26 | super(context, attrs); 27 | 28 | mPaint.setDither(true); 29 | mPaint.setAntiAlias(true); 30 | mPaint.setColor(Color.RED); 31 | } 32 | 33 | @Override 34 | protected void onDraw(Canvas canvas) { 35 | int width = getMeasuredWidth(); 36 | canvas.drawCircle(width / 2, width / 2, width / 2, mPaint); 37 | } 38 | 39 | public void startAnimator() { 40 | ObjectAnimator animatorX = ObjectAnimator.ofFloat(this, View.SCALE_X, 1, 2); 41 | animatorX.setDuration(500); 42 | ObjectAnimator animatorY = ObjectAnimator.ofFloat(this, View.SCALE_Y, 1, 2); 43 | animatorY.setDuration(500); 44 | 45 | AnimatorSet set = new AnimatorSet(); 46 | set.playTogether(animatorX, animatorY); 47 | set.start(); 48 | } 49 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/RoundCornerLayout.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.Color; 7 | import android.graphics.Paint; 8 | import android.graphics.RectF; 9 | import android.support.annotation.IntDef; 10 | import android.support.annotation.NonNull; 11 | import android.support.annotation.Nullable; 12 | import android.util.AttributeSet; 13 | import android.util.TypedValue; 14 | import android.widget.FrameLayout; 15 | 16 | import com.wuzhanglao.niubi.R; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | 21 | /** 22 | * Created by ming.wu@shanbay.com on 2017/6/12. 23 | */ 24 | 25 | public class RoundCornerLayout extends FrameLayout { 26 | 27 | public static final int ROUND = 1; 28 | public static final int RECT = 2; 29 | 30 | @IntDef({ROUND, RECT}) 31 | @Retention(RetentionPolicy.SOURCE) 32 | public @interface TYPE { 33 | 34 | } 35 | 36 | private static final int DEFAULT_COLOR = Color.LTGRAY; 37 | private static final int DEFAULT_TYPE = ROUND; 38 | private static final int DEFAULT_RADIUS = 0; 39 | 40 | private RectF mRectF = new RectF(); 41 | private Paint mPaint = new Paint(); 42 | 43 | private int mCornerColor; 44 | private int mCornerType; 45 | private int mCornerRadius; 46 | 47 | public RoundCornerLayout(@NonNull Context context) { 48 | this(context, null); 49 | } 50 | 51 | public RoundCornerLayout(@NonNull Context context, @Nullable AttributeSet attrs) { 52 | super(context, attrs); 53 | 54 | TypedArray ta = getResources().obtainAttributes(attrs, R.styleable.RoundCornerLayout); 55 | mCornerColor = ta.getColor(R.styleable.RoundCornerLayout_cornerColor, DEFAULT_COLOR); 56 | mCornerType = ta.getInt(R.styleable.RoundCornerLayout_cornerType, DEFAULT_TYPE); 57 | mCornerRadius = ta.getDimensionPixelSize(R.styleable.RoundCornerLayout_cornerRadius, DEFAULT_RADIUS); 58 | ta.recycle(); 59 | 60 | mPaint = new Paint(); 61 | mPaint.setDither(true); 62 | mPaint.setAntiAlias(true); 63 | mPaint.setStrokeWidth(0); 64 | mPaint.setStyle(Paint.Style.FILL); 65 | mPaint.setColor(mCornerColor); 66 | 67 | setWillNotDraw(false); 68 | } 69 | 70 | @Override 71 | protected void onSizeChanged(int w, int h, int oldw, int oldh) { 72 | super.onSizeChanged(w, h, oldw, oldh); 73 | mRectF.set(0, 0, getMeasuredWidth(), getMeasuredHeight()); 74 | } 75 | 76 | public void setCornerType(@TYPE int cornerType) { 77 | mCornerType = cornerType; 78 | invalidate(); 79 | } 80 | 81 | public void setCornerRadius(int dip) { 82 | Float value = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, getResources().getDisplayMetrics()); 83 | mCornerRadius = value.intValue(); 84 | invalidate(); 85 | } 86 | 87 | public void setCornerColor(int color) { 88 | mCornerColor = color; 89 | mPaint.setColor(mCornerColor); 90 | invalidate(); 91 | } 92 | 93 | @Override 94 | protected void onDraw(Canvas canvas) { 95 | float radius = 0; 96 | switch (mCornerType) { 97 | case ROUND: 98 | radius = mRectF.height() / 2.0f; 99 | break; 100 | case RECT: 101 | radius = mCornerRadius; 102 | break; 103 | } 104 | canvas.drawRoundRect(mRectF, radius, radius, mPaint); 105 | super.onDraw(canvas); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/RoundDrawable.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapShader; 5 | import android.graphics.Canvas; 6 | import android.graphics.ColorFilter; 7 | import android.graphics.Paint; 8 | import android.graphics.PixelFormat; 9 | import android.graphics.RectF; 10 | import android.graphics.Shader; 11 | import android.graphics.drawable.Drawable; 12 | 13 | /** 14 | * Created by ming.wu@shanbay.com on 2017/6/7. 15 | */ 16 | 17 | public class RoundDrawable extends Drawable { 18 | 19 | private Paint mPaint; 20 | private Bitmap mBitmap; 21 | 22 | private RectF rectF; 23 | 24 | public RoundDrawable(Bitmap bitmap) { 25 | mBitmap = bitmap; 26 | BitmapShader bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, 27 | Shader.TileMode.CLAMP); 28 | mPaint = new Paint(); 29 | mPaint.setAntiAlias(true); 30 | mPaint.setShader(bitmapShader); 31 | } 32 | 33 | @Override 34 | public void setBounds(int left, int top, int right, int bottom) { 35 | super.setBounds(left, top, right, bottom); 36 | rectF = new RectF(left, top, right, bottom); 37 | } 38 | 39 | @Override 40 | public void draw(Canvas canvas) { 41 | canvas.drawRoundRect(rectF, 30, 30, mPaint); 42 | } 43 | 44 | @Override 45 | public int getIntrinsicWidth() { 46 | return mBitmap.getWidth(); 47 | } 48 | 49 | @Override 50 | public int getIntrinsicHeight() { 51 | return mBitmap.getHeight(); 52 | } 53 | 54 | @Override 55 | public void setAlpha(int alpha) { 56 | mPaint.setAlpha(alpha); 57 | } 58 | 59 | @Override 60 | public void setColorFilter(ColorFilter cf) { 61 | mPaint.setColorFilter(cf); 62 | } 63 | 64 | @Override 65 | public int getOpacity() { 66 | return PixelFormat.TRANSLUCENT; 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /notes/src/main/java/com/wuzhanglao/widget/TestMeasureLayout.java: -------------------------------------------------------------------------------- 1 | package com.wuzhanglao.niubi.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Color; 5 | import android.util.AttributeSet; 6 | import android.util.Log; 7 | import android.view.View; 8 | import android.widget.ScrollView; 9 | import android.widget.TextView; 10 | 11 | /** 12 | * Created by wuming on 2017/1/16. 13 | */ 14 | 15 | public class TestMeasureLayout extends ScrollView { 16 | 17 | public TestMeasureLayout(Context context) { 18 | this(context, null); 19 | } 20 | 21 | public TestMeasureLayout(Context context, AttributeSet attrs) { 22 | super(context, attrs); 23 | TextView tv1 = new TextView(context); 24 | tv1.setText("tv1"); 25 | tv1.setBackgroundColor(Color.RED); 26 | addView(tv1); 27 | TextView tv2 = new TextView(context); 28 | tv2.setText("tv2"); 29 | tv2.setBackgroundColor(Color.GRAY); 30 | addView(tv2); 31 | TextView tv3 = new TextView(context); 32 | tv3.setText("tv3"); 33 | tv3.setBackgroundColor(Color.YELLOW); 34 | addView(tv3); 35 | } 36 | 37 | 38 | @Override 39 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { 40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec); 41 | 42 | int width = MeasureSpec.getSize(widthMeasureSpec); 43 | int width_mode = MeasureSpec.getMode(widthMeasureSpec); 44 | 45 | int height = MeasureSpec.getSize(heightMeasureSpec); 46 | int height_mode = MeasureSpec.getMode(heightMeasureSpec); 47 | 48 | Log.d("123123123", "width->" + width + " width_mode->" + width_mode + " height->" + height + " height_mode->" + height_mode); 49 | 50 | for (int i = 0; i < getChildCount(); i++) { 51 | View child = getChildAt(i); 52 | child.measure(MeasureSpec.makeMeasureSpec(480 - i * 100, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(480 - i * 100, MeasureSpec.EXACTLY)); 53 | } 54 | } 55 | 56 | @Override 57 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 58 | Log.d("123123123", "onLayout"); 59 | 60 | int currentLeft = 0; 61 | int currentTop = 0; 62 | for (int i = 0; i < getChildCount(); i++) { 63 | View child = getChildAt(i); 64 | child.layout(currentLeft, currentTop, currentLeft + child.getMeasuredWidth(), currentTop + child.getMeasuredHeight()); 65 | currentLeft = 0; 66 | currentTop = child.getBottom(); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/cube_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/cube_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/headline_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/headline_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/ios_dialog_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /notes/src/main/res/anim/ios_dialog_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/arrow.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/avatar.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bg_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bottom_dialog_cancel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bottom_dialog_option1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bottom_dialog_option13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bottom_dialog_option2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/bottom_dialog_option3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/btn_bg_colorfff_radius3.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/default_avatar.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/default_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/default_img.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/headline.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/headline.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/headline_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/heart.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/ic_toolbar_share_light.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/icon_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/icon_app.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/icon_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/icon_down.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/icon_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/icon_right.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/icon_toolbar_back_light.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/icon_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/icon_update.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/img1.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/img2.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/img3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/img3.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/img4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/img4.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/mail.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/navi_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/navi_bg.jpg -------------------------------------------------------------------------------- /notes/src/main/res/drawable/red_dot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/shape_gradient_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/shape_headline.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/shape_white_border_with_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/shape_white_border_with_corner2.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /notes/src/main/res/drawable/splash_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/splash_logo.png -------------------------------------------------------------------------------- /notes/src/main/res/drawable/splash_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Elder-Wu/Notes/eadf51ce3190fcf4d7724249b37b1c4e2c385cbe/notes/src/main/res/drawable/splash_text.png -------------------------------------------------------------------------------- /notes/src/main/res/layout/activity_demo.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /notes/src/main/res/layout/activity_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | -------------------------------------------------------------------------------- /notes/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 |