├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── hasee │ │ └── pangci │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── litepal.xml │ ├── ic_launcher-web.png │ ├── java │ │ └── com │ │ │ └── hasee │ │ │ └── pangci │ │ │ ├── X5 │ │ │ ├── APIWebviewTBS.java │ │ │ └── WebviewVideoActivity.java │ │ │ ├── activity │ │ │ ├── IntegralActivity.java │ │ │ ├── LockActivity.java │ │ │ ├── LoginActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MemberCenterActivity.java │ │ │ ├── NotificationActivity.java │ │ │ ├── RegisterActivity.java │ │ │ ├── SplashActivity.java │ │ │ ├── UpdatePasswordActivity.java │ │ │ └── VerifyLockActivity.java │ │ │ ├── adapter │ │ │ ├── CommonAdapter.java │ │ │ ├── MyFragmentPagerAdapter.java │ │ │ └── NotificationAdapter.java │ │ │ ├── app │ │ │ └── MyApplication.java │ │ │ ├── bean │ │ │ ├── FeedBack.java │ │ │ ├── Notice.java │ │ │ ├── NotificationBean.java │ │ │ ├── Resources.java │ │ │ └── User.java │ │ │ ├── common │ │ │ ├── CommonUtils.java │ │ │ ├── Constant.java │ │ │ ├── DataCleanManagerUtils.java │ │ │ ├── DateFormat.java │ │ │ ├── MessageEvent.java │ │ │ ├── MessageEvent2.java │ │ │ ├── MessageEventNotice.java │ │ │ └── ViewUtil.java │ │ │ ├── fragment │ │ │ ├── AnimeFragment.java │ │ │ ├── FeedBackFragment.java │ │ │ ├── MemberFragment.java │ │ │ ├── MovieFragment.java │ │ │ ├── NetdiskFragment.java │ │ │ ├── NotificationFragment.java │ │ │ └── RecommendFragment.java │ │ │ ├── interfaces │ │ │ └── RecyclerItemOnClickListener.java │ │ │ ├── permission │ │ │ ├── PermissionListener.java │ │ │ └── PermissionManager.java │ │ │ ├── receiver │ │ │ └── MyPushMessageReceiver.java │ │ │ └── widget │ │ │ ├── FadeInTextView.java │ │ │ ├── GraphicLockView.java │ │ │ └── Point.java │ └── res │ │ ├── drawable-xxhdpi │ │ ├── account.png │ │ ├── cache.png │ │ ├── change.png │ │ ├── delete.png │ │ ├── exit.png │ │ ├── flock.png │ │ ├── ic_22.png │ │ ├── ic_22_hide.png │ │ ├── ic_33.png │ │ ├── ic_33_hide.png │ │ ├── ic_avatar1.jpg │ │ ├── ic_avatar10.jpg │ │ ├── ic_avatar11.jpg │ │ ├── ic_avatar2.jpg │ │ ├── ic_avatar3.jpg │ │ ├── ic_avatar4.jpg │ │ ├── ic_avatar5.jpg │ │ ├── ic_avatar6.jpg │ │ ├── ic_avatar7.jpg │ │ ├── ic_avatar8.jpg │ │ ├── ic_avatar9.jpg │ │ ├── ic_navigation_drawer.png │ │ ├── ic_upper_loading_failed.png │ │ ├── icon_back_white.png │ │ ├── integral.png │ │ ├── inviter.png │ │ ├── lock.png │ │ ├── logo.png │ │ ├── logo_text.png │ │ ├── look.png │ │ ├── member.png │ │ ├── my_info.png │ │ ├── normal_login.png │ │ ├── not_message.png │ │ ├── notification.png │ │ ├── notification_message.png │ │ ├── open_slid_menu.png │ │ ├── password.png │ │ ├── play_ico.png │ │ ├── recommend.png │ │ ├── splash_logo.jpg │ │ ├── version.png │ │ ├── vip.png │ │ ├── weixing_zhifu.png │ │ └── yuan.png │ │ ├── drawable │ │ ├── btn_login_selector.xml │ │ ├── btn_login_text_selector.xml │ │ ├── btn_register_selector.xml │ │ ├── btn_register_text_selector.xml │ │ ├── edit_text_bg_shape.xml │ │ ├── exit_alter_dialog.xml │ │ ├── fab.xml │ │ ├── integral_tv_shape.xml │ │ ├── kefu.png │ │ ├── line_error.png │ │ ├── line_pressed.png │ │ ├── login_button_shape.xml │ │ ├── message_shape.xml │ │ ├── my_order_return_dialog.xml │ │ ├── point_error.png │ │ ├── point_normal.png │ │ ├── point_pressed.png │ │ ├── register_button_shape.xml │ │ ├── shap.xml │ │ └── verify_dialog_shape.xml │ │ ├── layout │ │ ├── activity_integral_acitvity.xml │ │ ├── activity_lock.xml │ │ ├── activity_login.xml │ │ ├── activity_main.xml │ │ ├── activity_member_center.xml │ │ ├── activity_notification.xml │ │ ├── activity_register.xml │ │ ├── activity_splash.xml │ │ ├── activity_update_password.xml │ │ ├── activity_verify_lock.xml │ │ ├── activity_webview_video.xml │ │ ├── dialog_activity_rule.xml │ │ ├── dialog_activity_rules.xml │ │ ├── feedback_fragment_layout.xml │ │ ├── item_notification_recycler_view_layout.xml │ │ ├── join_netdisk_dialog.xml │ │ ├── member_fragment_layout.xml │ │ ├── movie_fragment_layout.xml │ │ ├── navigation_view_header_layout.xml │ │ ├── notice.xml │ │ ├── notice_layout.xml │ │ ├── notification_fragment_layout.xml │ │ ├── pay_dialog_hint.xml │ │ ├── play_dialog_hint.xml │ │ ├── recommend_fragment_layout.xml │ │ ├── upgrade_dialog.xml │ │ ├── verify_dialog_hint.xml │ │ └── video_item.xml │ │ ├── menu │ │ ├── lock_menu.xml │ │ ├── login_menu.xml │ │ └── navigation_menu.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── provider_paths.xml │ └── test │ └── java │ └── com │ └── hasee │ └── pangci │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── text /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | 49 | # Google Services (e.g. APIs or Firebase) 50 | google-services.json 51 | 52 | # Freeline 53 | freeline.py 54 | freeline/ 55 | freeline_project_description.json 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PangCi -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.hasee.pangci" 8 | minSdkVersion 19 9 | targetSdkVersion 25 10 | versionCode 5 11 | versionName "4.0.2" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | ndk { 14 | //设置支持的SO库架构 15 | abiFilters 'armeabi', 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a' 16 | } 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | //**兼容Android6.0系统所需,如果这句话报错,可在dependencies标签下使用compile 'cn.bmob.android:http-legacy:1.0'** 25 | useLibrary 'org.apache.http.legacy' 26 | } 27 | 28 | dependencies { 29 | compile fileTree(include: ['*.jar'], dir: 'libs') 30 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 31 | exclude group: 'com.android.support', module: 'support-annotations' 32 | }) 33 | // bugly升级 34 | //Bmob数据服务 35 | //Bmob推送服务 36 | compile 'com.android.support:appcompat-v7:25.2.0' 37 | compile 'com.android.support:design:25.2.0' 38 | compile 'com.android.support:cardview-v7:25.2.0' 39 | compile 'cn.bmob.android:bmob-sdk:3.5.8' 40 | compile 'cn.bmob.android:bmob-push:1.0.1' 41 | compile 'com.jakewharton:butterknife:8.5.1' 42 | compile 'de.hdodenhof:circleimageview:2.0.0' 43 | compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8' 44 | compile 'org.greenrobot:eventbus:3.0.0' 45 | compile 'com.github.bumptech.glide:glide:3.5.2' 46 | compile 'org.litepal.android:core:1.3.0' 47 | compile 'com.tencent.bugly:crashreport_upgrade:1.3.1' 48 | testCompile 'junit:junit:4.12' 49 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' 50 | compile files('libs/tbs_sdk_thirdapp_v3.0.jar') 51 | } 52 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in F:\AndroidSDK\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 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/hasee/pangci/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.hasee.pangci", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 106 | 107 | 108 | 113 | 116 | 117 | 118 | 119 | 120 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /app/src/main/assets/litepal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/X5/APIWebviewTBS.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.X5; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.graphics.PixelFormat; 6 | import android.util.Log; 7 | import android.view.WindowManager; 8 | 9 | import com.tencent.smtt.sdk.QbSdk; 10 | import com.tencent.smtt.sdk.TbsListener; 11 | 12 | /** 13 | * Created by lsh on 2017/2/27. 14 | */ 15 | 16 | public class APIWebviewTBS { //二次封装tbs类,升级直接更换该类的方法\ 17 | 18 | private static APIWebviewTBS mAPIWebviewTBS; 19 | 20 | public static APIWebviewTBS getAPIWebview() { 21 | if (mAPIWebviewTBS == null) { 22 | synchronized (APIWebviewTBS.class) { 23 | if (mAPIWebviewTBS == null) { 24 | mAPIWebviewTBS = new APIWebviewTBS(); 25 | } 26 | } 27 | } 28 | return mAPIWebviewTBS; 29 | } 30 | 31 | public void initTbs(Context context) {//第一步:application的方法 32 | //搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。 33 | //TbsDownloader.needDownload(getApplicationContext(), false); 34 | QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() { 35 | @Override 36 | public void onViewInitFinished(boolean arg0) { 37 | // TODO Auto-generated method stub 38 | Log.e("app", " onViewInitFinished is " + arg0); 39 | } 40 | @Override 41 | public void onCoreInitFinished() { 42 | // TODO Auto-generated method stub 43 | } 44 | }; 45 | QbSdk.setTbsListener(new TbsListener() { 46 | @Override 47 | public void onDownloadFinish(int i) { 48 | Log.d("app","onDownloadFinish"); 49 | } 50 | 51 | @Override 52 | public void onInstallFinish(int i) { 53 | Log.d("app","onInstallFinish"); 54 | } 55 | 56 | @Override 57 | public void onDownloadProgress(int i) { 58 | Log.d("app","onDownloadProgress:"+i); 59 | } 60 | }); 61 | // QbSdk.initX5Environment(getApplicationContext(), cb); 62 | QbSdk.initX5Environment(context,cb); //二次封装更换 63 | } 64 | public void initTBSActivity(Activity ac){ //二次封装 65 | if (ac!=null){ 66 | ac.getWindow().setFormat(PixelFormat.TRANSLUCENT); 67 | ac.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 68 | } 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/X5/WebviewVideoActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.X5; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.KeyEvent; 7 | import android.view.View; 8 | import android.widget.ProgressBar; 9 | import android.widget.Toast; 10 | 11 | import com.hasee.pangci.R; 12 | import com.tencent.smtt.sdk.WebChromeClient; 13 | import com.tencent.smtt.sdk.WebSettings; 14 | import com.tencent.smtt.sdk.WebView; 15 | import com.tencent.smtt.sdk.WebViewClient; 16 | 17 | public class WebviewVideoActivity extends AppCompatActivity { 18 | // private String url="http://www.suomusic.com/dryCargoInfo.htm?mt=show&id=2"; //测试网址选择1 19 | // private String url="https://xinjiexi.cn/app/index.php?i=80&c=entry&do=index&m=super_mov";//测试网址选择2腾讯视频 20 | 21 | private String url = "http://api2.my230.com/?vid=goGA1UERkK104wtz";//测试网址选择2腾讯视频 22 | private WebView webView; 23 | private ProgressBar progressBar; 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_webview_video); 29 | 30 | Intent intent = getIntent(); 31 | url = intent.getStringExtra("url"); 32 | APIWebviewTBS.getAPIWebview().initTBSActivity(this); //api借口注册二次封装 33 | loadWebvieUrl(url); 34 | } 35 | // private void initdata() {//获取手机版本信息 36 | // int tbsVersion = QbSdk.getTbsVersion(this); 37 | // String TID = QbSdk.getTID(); 38 | // String qBVersion = QbSdk.getMiniQBVersion(this); 39 | // tvStatus.setText("TbsVersion:" + tbsVersion + "\nTID:" + TID + "\nMiniQBVersion:" + qBVersion); 40 | // } 41 | 42 | private void loadWebvieUrl(String url) { 43 | progressBar = (ProgressBar) findViewById(R.id.progressBar); 44 | webView = (WebView) findViewById(R.id.webview_wechat); 45 | WebSettings webSettings = webView.getSettings(); 46 | webSettings.setJavaScriptEnabled(true); 47 | webView.loadUrl(url); 48 | webView.setWebViewClient(new WebViewClient() { 49 | @Override 50 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 51 | view.loadUrl(url); 52 | return true; 53 | } 54 | 55 | @Override 56 | public void onReceivedError(WebView var1, int var2, String var3, String var4) { 57 | progressBar.setVisibility(View.GONE); 58 | Toast.makeText(WebviewVideoActivity.this, "视频加载失败", Toast.LENGTH_LONG); 59 | } 60 | }); 61 | //进度条 62 | webView.setWebChromeClient(new WebChromeClient() { 63 | @Override 64 | public void onProgressChanged(WebView view, int newProgress) { 65 | if (newProgress == 100) { 66 | progressBar.setVisibility(View.GONE); 67 | return; 68 | } 69 | progressBar.setVisibility(View.VISIBLE); 70 | progressBar.setProgress(newProgress); 71 | } 72 | }); 73 | } 74 | 75 | @Override 76 | protected void onDestroy() { 77 | super.onDestroy(); 78 | // 确保注销配置能够被释放 79 | // if(this.webView!=null){ 80 | // webView.destroy(); 81 | // } 82 | } 83 | 84 | @Override 85 | public boolean onKeyDown(int keyCode, KeyEvent event) { 86 | if (keyCode == KeyEvent.KEYCODE_BACK && webView.canGoBack()) { 87 | webView.goBack(); 88 | return true; 89 | } 90 | return super.onKeyDown(keyCode, event); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/IntegralActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.content.Intent; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.text.TextUtils; 9 | import android.util.Log; 10 | import android.view.View; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.bean.FeedBack; 16 | import com.hasee.pangci.bean.User; 17 | 18 | import java.util.List; 19 | 20 | import butterknife.BindView; 21 | import butterknife.ButterKnife; 22 | import butterknife.OnClick; 23 | import cn.bmob.v3.BmobQuery; 24 | import cn.bmob.v3.exception.BmobException; 25 | import cn.bmob.v3.listener.FindListener; 26 | import cn.bmob.v3.listener.SaveListener; 27 | import cn.bmob.v3.listener.UpdateListener; 28 | import de.hdodenhof.circleimageview.CircleImageView; 29 | 30 | 31 | public class IntegralActivity extends AppCompatActivity { 32 | @BindView(R.id.integral_iv_user_icon) 33 | CircleImageView mCircleImageView; 34 | @BindView(R.id.integral_tool_bar) 35 | Toolbar mToolbar; 36 | @BindView(R.id.integral_tv) 37 | TextView mIntegralTv; 38 | private User mUser; 39 | 40 | @OnClick(R.id.integral_confirm_tv) 41 | void onClick() { 42 | //兑换积分 43 | if (mUser != null) { 44 | String temp = mIntegralTv.getText().toString(); 45 | String substring = temp.substring(5, temp.length()); 46 | int integral = Integer.parseInt(substring);//当前积分 47 | if (integral >= 100) { 48 | //兑换后 修改数据库积分并新增一个月时间 存到sp 49 | updateAndQueryDb(); 50 | } else { 51 | Toast.makeText(this, "您的积分不足,赶紧邀请好友注册吧!", Toast.LENGTH_LONG).show(); 52 | } 53 | } 54 | } 55 | 56 | private void updateAndQueryDb() { 57 | //由于只能根据id去修改,先根据账号查 再修改 58 | BmobQuery bmobQuery = new BmobQuery<>(); 59 | bmobQuery.addWhereEqualTo("userAccount", mUser.getUserAccount()); 60 | bmobQuery.findObjects(new FindListener() { 61 | @Override 62 | public void done(List list, BmobException e) { 63 | if (e == null) { 64 | User user = list.get(0); 65 | updateDb(user.getObjectId(), user.getUserIntegral()); 66 | } else { 67 | Toast.makeText(IntegralActivity.this, "兑换出错,请重试!", Toast.LENGTH_SHORT).show(); 68 | } 69 | } 70 | }); 71 | } 72 | 73 | /*** 74 | * @param objectId 75 | * @param integral 需要减去的积分 76 | * @param oldIntegral 现有积分 77 | */ 78 | private void updateDb(String objectId, String oldIntegral) { 79 | int oIntergral = Integer.parseInt(oldIntegral); 80 | User user = new User(); 81 | final String tempIntegral = String.valueOf(oIntergral - 100); 82 | user.setUserIntegral(tempIntegral + ""); 83 | user.update(objectId, new UpdateListener() { 84 | @Override 85 | public void done(BmobException e) { 86 | if (e == null) { 87 | Toast.makeText(IntegralActivity.this, "兑换成功,请重新登录后获取会员时间!", Toast.LENGTH_SHORT).show(); 88 | mIntegralTv.setText("当前积分:" + tempIntegral); 89 | SharedPreferences login_info = getSharedPreferences("LOGIN_INFO", MODE_PRIVATE); 90 | SharedPreferences.Editor edit = login_info.edit(); 91 | edit.putString("integral", tempIntegral); 92 | edit.apply(); 93 | 94 | //兑换成功之后 插入表FeedBack 告知后台兑换了积分 然后给会员添加会员时间 如果是青铜则修改为白银 95 | FeedBack feedBack = new FeedBack(); 96 | feedBack.setUserName(mUser.getUserAccount()); 97 | feedBack.setContent("兑换积分成功"); 98 | feedBack.save(new SaveListener() { 99 | @Override 100 | public void done(String s, BmobException e) { 101 | if (e == null) { 102 | Log.i("FeedBack","成功"); 103 | }else { 104 | Log.i("FeedBack",e.getMessage()); 105 | } 106 | } 107 | }); 108 | } 109 | } 110 | }); 111 | } 112 | 113 | @Override 114 | protected void onCreate(Bundle savedInstanceState) { 115 | super.onCreate(savedInstanceState); 116 | setContentView(R.layout.activity_integral_acitvity); 117 | ButterKnife.bind(this); 118 | mToolbar.setTitle("我的积分"); 119 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 120 | @Override 121 | public void onClick(View v) { 122 | finish(); 123 | } 124 | }); 125 | getData(); 126 | } 127 | 128 | private void getData() { 129 | Intent intent = getIntent(); 130 | Bundle bundle = intent.getExtras(); 131 | mUser = (User) bundle.getSerializable("user"); 132 | Integer userHeadImg = mUser.getUserHeadImg(); 133 | String userIntegral = mUser.getUserIntegral(); 134 | mCircleImageView.setImageResource(userHeadImg); 135 | String temp = TextUtils.isEmpty(userIntegral) ? "当前积分:0" : "当前积分:" + userIntegral; 136 | mIntegralTv.setText(temp); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/LockActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.util.Log; 9 | import android.view.MenuItem; 10 | import android.view.View; 11 | import android.widget.LinearLayout; 12 | import android.widget.TextView; 13 | import android.widget.Toast; 14 | 15 | import com.hasee.pangci.R; 16 | import com.hasee.pangci.widget.GraphicLockView; 17 | 18 | public class LockActivity extends AppCompatActivity implements GraphicLockView.OnGraphicLockListener { 19 | 20 | private TextView mTvIno; 21 | private GraphicLockView mGlGraphicLockView; 22 | private boolean isFirstSetPwd; 23 | private String mPassword; //记录第一次绘制的密码 24 | private int type = 0; //判断时登录还是设置密码 25 | private Toolbar mToolbar; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_lock); 31 | 32 | initView(); 33 | } 34 | 35 | private void initView() { 36 | mTvIno = (TextView) findViewById(R.id.agl_tv_info); 37 | mGlGraphicLockView = (GraphicLockView) findViewById(R.id.agl_gl_lock); 38 | mToolbar=(Toolbar) findViewById(R.id.lock_tool_bar); 39 | isFirstSetPwd = true; 40 | mTvIno.setText("请绘制解锁图案"); 41 | 42 | mToolbar.setTitle("设置密码"); 43 | mToolbar.inflateMenu(R.menu.lock_menu); 44 | mToolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { 45 | @Override 46 | public boolean onMenuItemClick(MenuItem item) { 47 | showDialog("1.手势密码设置不是必须的","2.一旦设置密码之后,下次进入应用需验证手势密码","3.成功绘制两次之后即代表密码设置成功"); 48 | return false; 49 | } 50 | }); 51 | mGlGraphicLockView.setOnGraphicLockListener(this); 52 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 53 | @Override 54 | public void onClick(View v) { 55 | finish(); 56 | } 57 | }); 58 | } 59 | 60 | @Override 61 | public void setPwdSuccess(String password) { 62 | if (type == 0) { //设置密码 63 | if (isFirstSetPwd) { 64 | mTvIno.setText("再次绘制图案进行确认"); 65 | mPassword = password; 66 | isFirstSetPwd = false; 67 | } else { 68 | if (mPassword.equals(password)) { 69 | Log.d("GraphicLockActivity--->", "password====" + mPassword); 70 | Toast.makeText(this, "设置密码成功", Toast.LENGTH_LONG).show(); 71 | mTvIno.setText("下次进入应用时需验证此手势密码"); 72 | //存到Sp里面 73 | SharedPreferences lock_info = getSharedPreferences("LOCK_INFO", MODE_PRIVATE); 74 | SharedPreferences.Editor edit = lock_info.edit(); 75 | edit.putBoolean("isSetting",true); 76 | edit.putString("lockPwd",mPassword); 77 | edit.apply(); 78 | // type = 1; 79 | } else { 80 | Toast.makeText(this, "两次设置的密码不一致,请重试", Toast.LENGTH_SHORT).show(); 81 | } 82 | } 83 | } 84 | /* else if (type == 1) { //登录 85 | if (mPassword.equals(password)) { 86 | Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show(); 87 | startActivity(new Intent(this, MainActivity.class)); 88 | finish(); 89 | } else { 90 | Toast.makeText(this, "密码错误,登录失败", Toast.LENGTH_SHORT).show(); 91 | } 92 | }*/ 93 | } 94 | 95 | @Override 96 | protected void onDestroy() { 97 | super.onDestroy(); 98 | isFirstSetPwd = true; 99 | mPassword = ""; 100 | } 101 | 102 | @Override 103 | public void setPwdFailure() { 104 | if (type == 0) { 105 | mTvIno.setText("请至少连接四个点"); 106 | Toast.makeText(this, "密码过短,设置失败", Toast.LENGTH_SHORT).show(); 107 | } 108 | 109 | /* else if (type == 1) { 110 | mTvIno.setText("你可以登录了"); 111 | Toast.makeText(this, "密码错误,登录失败", Toast.LENGTH_SHORT).show(); 112 | }*/ 113 | } 114 | 115 | private void showDialog(String tv1, String tv2, String tv3) { 116 | 117 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 118 | 119 | /** 120 | * 设置内容区域为自定义View 121 | */ 122 | LinearLayout inflate_dialog= (LinearLayout) getLayoutInflater().inflate(R.layout.pay_dialog_hint,null); 123 | builder.setView(inflate_dialog); 124 | 125 | final AlertDialog dialog=builder.create(); 126 | dialog.show(); 127 | 128 | TextView tv_1 = (TextView) inflate_dialog.findViewById(R.id.tv_1); 129 | TextView tv_2 = (TextView) inflate_dialog.findViewById(R.id.tv_2); 130 | TextView tv_3 = (TextView) inflate_dialog.findViewById(R.id.tv_3); 131 | TextView tv_title = (TextView) inflate_dialog.findViewById(R.id.tv_title); 132 | tv_title.setText("设置说明"); 133 | tv_1.setText(tv1); 134 | tv_2.setText(tv2); 135 | tv_3.setText(tv3); 136 | TextView tvConfirm = (TextView) inflate_dialog.findViewById(R.id.tv_comfirm); 137 | tvConfirm.setOnClickListener(new View.OnClickListener() { 138 | @Override 139 | public void onClick(View v) { 140 | dialog.dismiss(); 141 | } 142 | }); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/MemberCenterActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AlertDialog; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.CardView; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | import android.widget.LinearLayout; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.bean.User; 16 | 17 | import java.util.List; 18 | 19 | import butterknife.BindView; 20 | import butterknife.BindViews; 21 | import butterknife.ButterKnife; 22 | import butterknife.OnClick; 23 | import de.hdodenhof.circleimageview.CircleImageView; 24 | 25 | public class MemberCenterActivity extends AppCompatActivity implements View.OnClickListener { 26 | 27 | @BindView(R.id.ll_weixin) 28 | LinearLayout llWeixin; 29 | @BindView(R.id.member_center_tool_bar) 30 | Toolbar mToolbar; 31 | @BindView(R.id.tv_user_name) 32 | TextView mUserNameTv; 33 | @BindView(R.id.tv_user_member_level) 34 | TextView mMemberLevelTv; 35 | @BindView(R.id.iv_user_icon) 36 | CircleImageView mHeadIcon; 37 | @BindViews({R.id.member_center_v1_cv, R.id.member_center_v2_cv, R.id.member_center_v3_cv, R.id.member_center_v4_cv}) 38 | List mCardViews; 39 | private int mFlags; 40 | @BindView(R.id.activity_rechange) 41 | LinearLayout mLinearLayout; 42 | 43 | @OnClick(R.id.iv_user_icon) 44 | void onClick() { 45 | if (mFlags == 0){ 46 | Intent intent = new Intent(this,LoginActivity.class); 47 | startActivity(intent); 48 | finish(); 49 | } 50 | } 51 | 52 | @Override 53 | protected void onCreate(Bundle savedInstanceState) { 54 | super.onCreate(savedInstanceState); 55 | setContentView(R.layout.activity_member_center); 56 | ButterKnife.bind(this); 57 | getIntentData(); 58 | initEvents(); 59 | } 60 | 61 | private void initEvents() { 62 | llWeixin.setOnClickListener(this); 63 | mToolbar.setTitle("会员中心"); 64 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 65 | @Override 66 | public void onClick(View v) { 67 | finish(); 68 | } 69 | }); 70 | 71 | for (CardView cardView : mCardViews) { 72 | cardView.setOnClickListener(this); 73 | } 74 | } 75 | 76 | private void getIntentData() { 77 | Intent intent = getIntent(); 78 | mFlags = intent.getFlags(); 79 | if (mFlags == 1) { 80 | Bundle bundle = intent.getExtras(); 81 | User user = (User) bundle.getSerializable("user"); 82 | mUserNameTv.setText(user.getUserAccount()); 83 | mMemberLevelTv.setText("当前等级:" + user.getMemberLevel()); 84 | mHeadIcon.setImageResource(user.getUserHeadImg()); 85 | } else { 86 | mUserNameTv.setText("未登录"); 87 | mMemberLevelTv.setText("请先登录"); 88 | mHeadIcon.setImageResource(R.drawable.normal_login); 89 | } 90 | } 91 | 92 | private void showDialog(String tv1, String tv2, String tv3) { 93 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 94 | 95 | /** 96 | * 设置内容区域为自定义View 97 | */ 98 | LinearLayout inflate_dialog= (LinearLayout) getLayoutInflater().inflate(R.layout.pay_dialog_hint,null); 99 | builder.setView(inflate_dialog); 100 | 101 | final AlertDialog dialog=builder.create(); 102 | dialog.show(); 103 | 104 | TextView tv_1 = (TextView) inflate_dialog.findViewById(R.id.tv_1); 105 | TextView tv_2 = (TextView) inflate_dialog.findViewById(R.id.tv_2); 106 | TextView tv_3 = (TextView) inflate_dialog.findViewById(R.id.tv_3); 107 | TextView tv_title = (TextView) inflate_dialog.findViewById(R.id.tv_title); 108 | tv_title.setText("充值提示"); 109 | tv_1.setText(tv1); 110 | tv_2.setText(tv2); 111 | tv_3.setText(tv3); 112 | TextView tvConfirm = (TextView) inflate_dialog.findViewById(R.id.tv_comfirm); 113 | tvConfirm.setOnClickListener(new View.OnClickListener() { 114 | @Override 115 | public void onClick(View v) { 116 | dialog.dismiss(); 117 | } 118 | }); 119 | } 120 | 121 | @Override 122 | public void onClick(View v) { 123 | switch (v.getId()) { 124 | case R.id.ll_weixin: 125 | showDialog("1.请关注微信公众号“壹号电影", "2.点击该公众号菜单栏“胖次有你”找到充值一栏即可开通", "3.充值成功后,请重新登录账号,获取会员权限"); 126 | break; 127 | 128 | case R.id.member_center_v1_cv: 129 | Toast.makeText(this, "请选择下面的充值方式进行开通或续费!", Toast.LENGTH_SHORT).show(); 130 | break; 131 | 132 | case R.id.member_center_v2_cv: 133 | Toast.makeText(this, "请选择下面的充值方式进行开通或续费!", Toast.LENGTH_SHORT).show(); 134 | break; 135 | 136 | case R.id.member_center_v3_cv: 137 | Toast.makeText(this, "请选择下面的充值方式进行开通或续费!", Toast.LENGTH_SHORT).show(); 138 | break; 139 | 140 | case R.id.member_center_v4_cv: 141 | Toast.makeText(this, "请选择下面的充值方式进行开通或续费!", Toast.LENGTH_SHORT).show(); 142 | break; 143 | 144 | default: 145 | 146 | break; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/NotificationActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.TabLayout; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v4.view.ViewPager; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | 11 | import com.hasee.pangci.R; 12 | import com.hasee.pangci.adapter.MyFragmentPagerAdapter; 13 | import com.hasee.pangci.fragment.FeedBackFragment; 14 | import com.hasee.pangci.fragment.NotificationFragment; 15 | 16 | import java.util.ArrayList; 17 | 18 | import butterknife.BindView; 19 | import butterknife.ButterKnife; 20 | 21 | public class NotificationActivity extends AppCompatActivity { 22 | @BindView(R.id.notification_tool_bar) 23 | Toolbar mToolbar; 24 | @BindView(R.id.notification_tab_layout) 25 | TabLayout mTabLayout; 26 | @BindView(R.id.notification_view_pager) 27 | ViewPager mViewPager; 28 | private FeedBackFragment feedBackFragment = new FeedBackFragment(); 29 | private NotificationFragment notificationFragment = new NotificationFragment(); 30 | private Fragment[] fragments = {notificationFragment, feedBackFragment}; 31 | private String[] titles = {"系统消息", "帮助与反馈"}; 32 | private ArrayList mFragmentArrayList = new ArrayList<>(); 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_notification); 38 | ButterKnife.bind(this); 39 | mToolbar.setTitle("我的消息"); 40 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 41 | @Override 42 | public void onClick(View v) { 43 | finish(); 44 | } 45 | }); 46 | 47 | //fragment 数据源 48 | for (int i = 0; i < fragments.length; i++) { 49 | mFragmentArrayList.add(fragments[i]); 50 | } 51 | 52 | MyFragmentPagerAdapter myFragmentPagerAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager(), mFragmentArrayList); 53 | mViewPager.setAdapter(myFragmentPagerAdapter); 54 | //关联彼此 55 | mTabLayout.setupWithViewPager(mViewPager); 56 | for (int i = 0; i < titles.length; i++) { 57 | mTabLayout.getTabAt(i).setText(titles[i]); 58 | } 59 | } 60 | 61 | @Override 62 | protected void onResume() { 63 | super.onResume(); 64 | int flags = getIntent().getFlags(); 65 | switch (flags) { 66 | case 0: 67 | mViewPager.setCurrentItem(0); 68 | break; 69 | 70 | case 1: 71 | mViewPager.setCurrentItem(1); 72 | break; 73 | 74 | default: 75 | break; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/SplashActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.animation.Animator; 4 | import android.animation.AnimatorListenerAdapter; 5 | import android.animation.AnimatorSet; 6 | import android.animation.ObjectAnimator; 7 | import android.content.Intent; 8 | import android.content.SharedPreferences; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.view.WindowManager; 13 | import android.widget.ImageView; 14 | 15 | import com.hasee.pangci.R; 16 | 17 | import butterknife.BindView; 18 | import butterknife.ButterKnife; 19 | 20 | public class SplashActivity extends AppCompatActivity { 21 | @BindView(R.id.iv_splash) 22 | ImageView mImageView; 23 | private AnimatorSet mAnimatorSet; 24 | private boolean mIsSetting; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 30 | //透明状态栏 31 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 32 | //透明导航栏 33 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); 34 | } 35 | setContentView(R.layout.activity_splash); 36 | ButterKnife.bind(this); 37 | 38 | mAnimatorSet = new AnimatorSet(); 39 | ObjectAnimator objectAnimatorX = ObjectAnimator.ofFloat(mImageView, "translationX", 600, 0); 40 | ObjectAnimator objectAnimatorY = ObjectAnimator.ofFloat(mImageView, "translationY", -100, 90, -80, 70, -60, 50); 41 | mAnimatorSet.playTogether(objectAnimatorX,objectAnimatorY); 42 | mAnimatorSet.setDuration(2000); 43 | addListener(); 44 | 45 | 46 | //判断是否有设置手势密码 47 | SharedPreferences lock_info = getSharedPreferences("LOCK_INFO", MODE_PRIVATE); 48 | mIsSetting = lock_info.getBoolean("isSetting", false); 49 | } 50 | 51 | private void addListener() { 52 | mAnimatorSet.start(); 53 | mAnimatorSet.addListener(new AnimatorListenerAdapter() { 54 | @Override 55 | public void onAnimationEnd(Animator animation) { 56 | try { 57 | Thread.sleep(500); 58 | if(mIsSetting){ 59 | Intent intent = new Intent(SplashActivity.this,VerifyLockActivity.class); 60 | startActivity(intent); 61 | finish(); 62 | }else { 63 | Intent intent = new Intent(SplashActivity.this,MainActivity.class); 64 | startActivity(intent); 65 | finish(); 66 | } 67 | } catch (InterruptedException e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | }); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/UpdatePasswordActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.support.v7.widget.Toolbar; 6 | import android.view.View; 7 | import android.widget.EditText; 8 | import android.widget.Toast; 9 | 10 | import com.hasee.pangci.R; 11 | import com.hasee.pangci.common.CommonUtils; 12 | import com.hasee.pangci.bean.User; 13 | 14 | import java.util.List; 15 | 16 | import butterknife.BindView; 17 | import butterknife.ButterKnife; 18 | import butterknife.OnClick; 19 | import cn.bmob.v3.BmobQuery; 20 | import cn.bmob.v3.exception.BmobException; 21 | import cn.bmob.v3.listener.FindListener; 22 | import cn.bmob.v3.listener.UpdateListener; 23 | 24 | public class UpdatePasswordActivity extends AppCompatActivity { 25 | @BindView(R.id.update_tool_bar) 26 | Toolbar mToolbar; 27 | @BindView(R.id.update_account_et) 28 | EditText mAccountEditText; 29 | @BindView(R.id.update_password_et) 30 | EditText mPasswordEditText; 31 | @BindView(R.id.update_password_again_et) 32 | EditText mAgainPasswordEt; 33 | private String objectId = null; //需要修改账号的id 34 | 35 | @OnClick(R.id.update_confirm_tv) 36 | void click() { 37 | updatePassword(); 38 | } 39 | 40 | @Override 41 | protected void onCreate(Bundle savedInstanceState) { 42 | super.onCreate(savedInstanceState); 43 | setContentView(R.layout.activity_update_password); 44 | ButterKnife.bind(this); 45 | mToolbar.setTitle("重置密码"); 46 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 47 | @Override 48 | public void onClick(View v) { 49 | finish(); 50 | } 51 | }); 52 | } 53 | 54 | public void updatePassword() { 55 | 56 | String account = mAccountEditText.getText().toString().trim(); 57 | String password = mPasswordEditText.getText().toString().trim(); 58 | String againPassword = mAgainPasswordEt.getText().toString().trim(); 59 | if (CommonUtils.checkStrIsNull(account, password, againPassword)) { 60 | Toast.makeText(this, "选项不能为空!", Toast.LENGTH_SHORT).show(); 61 | return; 62 | } else if (!password.equals(againPassword) || password.length() < 6) { 63 | Toast.makeText(this, "密码输入不一致且长度得大于6位数!", Toast.LENGTH_SHORT).show(); 64 | return; 65 | }else if (!password.matches("[a-zA-Z0-9]{1,16}")) { 66 | Toast.makeText(this, "密码由字母和数字构成,不能超过16位", Toast.LENGTH_LONG).show(); 67 | return; 68 | } 69 | //由于只能通过objectId修改数据 先根据用户名查询到id 70 | BmobQuery bmobQuery = new BmobQuery<>(); 71 | bmobQuery.addWhereEqualTo("userAccount", account); 72 | bmobQuery.findObjects(new FindListener() { 73 | @Override 74 | public void done(List list, BmobException e) { 75 | if (e == null) { 76 | if (list.size() != 0) { 77 | //注册账号的时候已经限制不重名 所以有且只有一个直接取第一个 78 | User user = list.get(0); 79 | objectId = user.getObjectId(); 80 | } else { 81 | Toast.makeText(UpdatePasswordActivity.this, "账号不存在!", Toast.LENGTH_SHORT).show(); 82 | } 83 | } else { 84 | Toast.makeText(UpdatePasswordActivity.this, "服务器繁忙,请稍后重试", Toast.LENGTH_SHORT).show(); 85 | } 86 | } 87 | }); 88 | 89 | //修改操作 90 | if (objectId == null) {return;} 91 | User user = new User(); 92 | user.setUserPassword(password); 93 | user.update(objectId, new UpdateListener() { 94 | @Override 95 | public void done(BmobException e) { 96 | if (e == null) { 97 | Toast.makeText(UpdatePasswordActivity.this, "修改成功!", Toast.LENGTH_SHORT).show(); 98 | finish(); 99 | } else { 100 | Toast.makeText(UpdatePasswordActivity.this, "修改失败,请重试!", Toast.LENGTH_SHORT).show(); 101 | } 102 | } 103 | }); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/activity/VerifyLockActivity.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.activity; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.os.Build; 7 | import android.os.Bundle; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.WindowManager; 12 | import android.widget.EditText; 13 | import android.widget.TextView; 14 | import android.widget.Toast; 15 | 16 | import com.hasee.pangci.R; 17 | import com.hasee.pangci.widget.GraphicLockView; 18 | 19 | import butterknife.BindView; 20 | import butterknife.ButterKnife; 21 | import butterknife.OnClick; 22 | 23 | public class VerifyLockActivity extends AppCompatActivity { 24 | @BindView(R.id.verify_agl_gl_lock) 25 | GraphicLockView mGraphicLockView; 26 | private String mAccount; 27 | private String mPassword; 28 | 29 | @OnClick(R.id.verify_forget_pwd_tv) 30 | void onClick() { 31 | //弹窗提示 32 | showDialog(); 33 | } 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 39 | //透明状态栏 40 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 41 | //透明导航栏 42 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); 43 | } 44 | setContentView(R.layout.activity_verify_lock); 45 | ButterKnife.bind(this); 46 | 47 | //获取存取的手势锁信息 48 | SharedPreferences lock_info = getSharedPreferences("LOCK_INFO", MODE_PRIVATE); 49 | final String lockPwd = lock_info.getString("lockPwd", ""); 50 | 51 | //获取存取的登录信息 52 | SharedPreferences login_info = getSharedPreferences("LOGIN_INFO", MODE_PRIVATE); 53 | mAccount = login_info.getString("account", ""); 54 | mPassword = login_info.getString("password", ""); 55 | 56 | mGraphicLockView.setOnGraphicLockListener(new GraphicLockView.OnGraphicLockListener() { 57 | @Override 58 | public void setPwdSuccess(String password) { 59 | if (lockPwd.equals(password)) { 60 | Intent intent = new Intent(VerifyLockActivity.this, MainActivity.class); 61 | startActivity(intent); 62 | finish(); 63 | } else { 64 | Toast.makeText(VerifyLockActivity.this, "手势密码有误!", Toast.LENGTH_LONG).show(); 65 | } 66 | } 67 | 68 | @Override 69 | public void setPwdFailure() { 70 | 71 | } 72 | }); 73 | } 74 | 75 | private void showDialog() { 76 | 77 | final AlertDialog hintDialog = new AlertDialog.Builder(VerifyLockActivity.this, R.style.ShowDialog).create(); 78 | View inflate_dialog = LayoutInflater.from(VerifyLockActivity.this).inflate(R.layout.verify_dialog_hint, null); 79 | hintDialog.show(); 80 | hintDialog.setContentView(inflate_dialog); 81 | 82 | TextView account = (TextView) inflate_dialog.findViewById(R.id.tv_account); 83 | TextView confirm = (TextView) inflate_dialog.findViewById(R.id.tv_confirm); 84 | TextView cancel = (TextView) inflate_dialog.findViewById(R.id.tv_cancel); 85 | cancel.setOnClickListener(new View.OnClickListener() { 86 | @Override 87 | public void onClick(View v) { 88 | hintDialog.dismiss(); 89 | } 90 | }); 91 | final EditText password = (EditText) inflate_dialog.findViewById(R.id.et_pwd); 92 | account.setText("胖次账户:"+mAccount); 93 | confirm.setOnClickListener(new View.OnClickListener() { 94 | @Override 95 | public void onClick(View v) { 96 | if(password.getText().toString().trim().equals(mPassword)){ 97 | Intent intent = new Intent(VerifyLockActivity.this,MainActivity.class); 98 | startActivity(intent); 99 | finish(); 100 | }else { 101 | Toast.makeText(VerifyLockActivity.this, "密码有误,请重新输入!", Toast.LENGTH_SHORT).show(); 102 | } 103 | } 104 | }); 105 | 106 | hintDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/adapter/MyFragmentPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import java.util.ArrayList; 8 | 9 | 10 | public class MyFragmentPagerAdapter extends FragmentPagerAdapter { 11 | private ArrayList fragmentArrayList; 12 | 13 | public MyFragmentPagerAdapter(FragmentManager fm, ArrayList fragments) { 14 | super(fm); 15 | fragmentArrayList = fragments; 16 | } 17 | 18 | @Override 19 | public Fragment getItem(int position) { 20 | return fragmentArrayList.get(position); 21 | } 22 | 23 | @Override 24 | public int getCount() { 25 | return fragmentArrayList.size(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/adapter/NotificationAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Color; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.text.SpannableString; 7 | import android.text.Spanned; 8 | import android.text.style.ForegroundColorSpan; 9 | import android.text.style.UnderlineSpan; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.widget.TextView; 14 | 15 | import com.hasee.pangci.R; 16 | import com.hasee.pangci.bean.NotificationBean; 17 | import com.hasee.pangci.interfaces.RecyclerItemOnClickListener; 18 | 19 | import java.util.ArrayList; 20 | 21 | import butterknife.BindView; 22 | import butterknife.ButterKnife; 23 | 24 | 25 | public class NotificationAdapter extends RecyclerView.Adapter { 26 | private ArrayList notificationBeanArrayList; 27 | private Context mContext; 28 | private LayoutInflater mLayoutInflater; 29 | 30 | public NotificationAdapter(ArrayList notificationBeanArrayList, Context context) { 31 | this.notificationBeanArrayList = notificationBeanArrayList; 32 | this.mContext = context; 33 | mLayoutInflater = LayoutInflater.from(mContext); 34 | } 35 | 36 | @Override 37 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 38 | View view = mLayoutInflater.inflate(R.layout.item_notification_recycler_view_layout, parent, false); 39 | ViewHolder viewHolder = new ViewHolder(view); 40 | return viewHolder; 41 | } 42 | 43 | @Override 44 | public void onBindViewHolder(ViewHolder holder, final int position) { 45 | NotificationBean notificationBean = notificationBeanArrayList.get(position); 46 | 47 | if ("1".equals(notificationBean.getTag())) { 48 | String notificationContent = notificationBean.getNotificationContent(); 49 | //链接 颜色加深 可点击跳转 50 | SpannableString spannableString = new SpannableString(notificationContent); 51 | //下划线 52 | UnderlineSpan underlineSpan = new UnderlineSpan(); 53 | spannableString.setSpan(underlineSpan, notificationContent.indexOf(":") + 1, notificationContent.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); 54 | //颜色 55 | ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.BLUE); 56 | spannableString.setSpan(foregroundColorSpan, notificationContent.indexOf(":") + 1, notificationContent.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE); 57 | holder.mContentTv.setText(spannableString); 58 | } else { 59 | holder.mContentTv.setText(notificationBean.getNotificationContent()); 60 | } 61 | 62 | holder.itemView.setOnLongClickListener(new View.OnLongClickListener() { 63 | @Override 64 | public boolean onLongClick(View v) { 65 | recyclerItemOnClickListener.onItemLongClick(position); 66 | return false; 67 | } 68 | }); 69 | 70 | holder.itemView.setOnClickListener(new View.OnClickListener() { 71 | @Override 72 | public void onClick(View v) { 73 | recyclerItemOnClickListener.onItemClick(position); 74 | } 75 | }); 76 | } 77 | 78 | @Override 79 | public int getItemCount() { 80 | return notificationBeanArrayList.size(); 81 | } 82 | 83 | static class ViewHolder extends RecyclerView.ViewHolder { 84 | @BindView(R.id.item_content_tv) 85 | TextView mContentTv; 86 | 87 | public ViewHolder(View itemView) { 88 | super(itemView); 89 | ButterKnife.bind(this, itemView); 90 | } 91 | } 92 | 93 | private RecyclerItemOnClickListener recyclerItemOnClickListener; 94 | 95 | public void setRecyclerItemOnClickListener(RecyclerItemOnClickListener recyclerItemOnClickListener) { 96 | this.recyclerItemOnClickListener = recyclerItemOnClickListener; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/app/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.app; 2 | 3 | import android.os.Environment; 4 | import android.util.Log; 5 | 6 | import com.hasee.pangci.R; 7 | import com.hasee.pangci.X5.APIWebviewTBS; 8 | import com.hasee.pangci.activity.MainActivity; 9 | import com.hasee.pangci.common.Constant; 10 | import com.tencent.bugly.Bugly; 11 | import com.tencent.bugly.beta.Beta; 12 | 13 | import org.litepal.LitePalApplication; 14 | 15 | import cn.bmob.push.BmobPush; 16 | import cn.bmob.v3.Bmob; 17 | import cn.bmob.v3.BmobInstallation; 18 | import cn.bmob.v3.BmobInstallationManager; 19 | import cn.bmob.v3.InstallationListener; 20 | import cn.bmob.v3.exception.BmobException; 21 | 22 | public class MyApplication extends LitePalApplication { 23 | private APIWebviewTBS mAPIWebviewTBS; 24 | 25 | @Override 26 | public void onCreate() { 27 | super.onCreate(); 28 | //个人封装,针对升级----开始 29 | mAPIWebviewTBS=APIWebviewTBS.getAPIWebview(); 30 | mAPIWebviewTBS.initTbs(getApplicationContext()); 31 | //个人封装,针对升级----结束 32 | Bmob.initialize(this, Constant.BMOBAPPLICATIONID); 33 | // 使用推送服务时的初始化操作 34 | BmobInstallationManager.getInstance().initialize(new InstallationListener() { 35 | @Override 36 | public void done(BmobInstallation bmobInstallation, BmobException e) { 37 | if (e == null) { 38 | Log.i("APP", bmobInstallation.getObjectId() + "----" + bmobInstallation.getInstallationId()); 39 | } else { 40 | Log.i("APP", e.getMessage()); 41 | } 42 | } 43 | }); 44 | //启动推送服务 45 | BmobPush.startWork(this); 46 | 47 | 48 | /**** Beta高级设置*****/ 49 | /** 50 | * true表示app启动自动初始化升级模块; 51 | * false不好自动初始化 52 | * 开发者如果担心sdk初始化影响app启动速度,可以设置为false 53 | * 在后面某个时刻手动调用 54 | */ 55 | Beta.autoInit = true; 56 | 57 | /** 58 | * true表示初始化时自动检查升级 59 | * false表示不会自动检查升级,需要手动调用Beta.checkUpgrade()方法 60 | */ 61 | Beta.autoCheckUpgrade = true; 62 | 63 | /** 64 | * 设置升级周期为60s(默认检查周期为0s),60s内SDK不重复向后天请求策略 65 | */ 66 | Beta.initDelay = 1000; 67 | 68 | /** 69 | * 设置通知栏大图标,largeIconId为项目中的图片资源; 70 | */ 71 | Beta.largeIconId = R.drawable.logo; 72 | 73 | /** 74 | * 设置状态栏小图标,smallIconId为项目中的图片资源id; 75 | */ 76 | Beta.smallIconId = R.drawable.logo; 77 | 78 | 79 | /** 80 | * 设置更新弹窗默认展示的banner,defaultBannerId为项目中的图片资源Id; 81 | * 当后台配置的banner拉取失败时显示此banner,默认不设置则展示“loading“; 82 | */ 83 | Beta.defaultBannerId = R.drawable.logo; 84 | 85 | /** 86 | * 设置sd卡的Download为更新资源保存目录; 87 | * 后续更新资源会保存在此目录,需要在manifest中添加WRITE_EXTERNAL_STORAGE权限; 88 | */ 89 | Beta.storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); 90 | 91 | /** 92 | * 点击过确认的弹窗在APP下次启动自动检查更新时会再次显示; 93 | */ 94 | Beta.showInterruptedStrategy = false; 95 | 96 | /** 97 | * 只允许在MainActivity上显示更新弹窗,其他activity上不显示弹窗; 98 | * 不设置会默认所有activity都可以显示弹窗; 99 | */ 100 | Beta.canShowUpgradeActs.add(MainActivity.class); 101 | 102 | 103 | /** 104 | * 设置自定义升级对话框UI布局 105 | * 注意:因为要保持接口统一,需要用户在指定控件按照以下方式设置tag,否则会影响您的正常使用: 106 | * 标题:beta_title,如:android:tag="beta_title" 107 | * 升级信息:beta_upgrade_info 如: android:tag="beta_upgrade_info" 108 | * 更新属性:beta_upgrade_feature 如: android:tag="beta_upgrade_feature" 109 | * 取消按钮:beta_cancel_button 如:android:tag="beta_cancel_button" 110 | * 确定按钮:beta_confirm_button 如:android:tag="beta_confirm_button" 111 | * 详见layout/upgrade_dialog.xml 112 | */ 113 | Beta.upgradeDialogLayoutId = R.layout.upgrade_dialog; 114 | 115 | /** 116 | * 已经接入Bugly用户改用上面的初始化方法,不影响原有的crash上报功能; 117 | * init方法会自动检测更新,不需要再手动调用Beta.checkUpdate(),如需增加自动检查时机可以使用Beta.checkUpdate(false,false); 118 | * 参数1: applicationContext 119 | * 参数2:appId 120 | * 参数3:是否开启debug 121 | */ 122 | Bugly.init(getApplicationContext(), Constant.BUGLYAPPLICATIONID, true); 123 | 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/bean/FeedBack.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.bean; 2 | 3 | 4 | import cn.bmob.v3.BmobObject; 5 | 6 | public class FeedBack extends BmobObject{ 7 | 8 | private String userName; 9 | 10 | private String content; 11 | 12 | public String getUserName() { 13 | return userName; 14 | } 15 | 16 | public void setUserName(String userName) { 17 | this.userName = userName; 18 | } 19 | 20 | public String getContent() { 21 | return content; 22 | } 23 | 24 | public void setContent(String content) { 25 | this.content = content; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "FeedBack{" + 31 | "userName='" + userName + '\'' + 32 | ", content='" + content + '\'' + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/bean/Notice.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.bean; 2 | 3 | import org.litepal.crud.DataSupport; 4 | 5 | public class Notice extends DataSupport{ 6 | 7 | private String notice; 8 | 9 | public String getNotice() { 10 | return notice; 11 | } 12 | 13 | public void setNotice(String notice) { 14 | this.notice = notice; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/bean/NotificationBean.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.bean; 2 | 3 | 4 | import org.litepal.crud.DataSupport; 5 | 6 | public class NotificationBean extends DataSupport{ 7 | 8 | private long id; 9 | 10 | private String notificationContent; 11 | 12 | private String tag; 13 | 14 | public String getNotificationContent() { 15 | return notificationContent; 16 | } 17 | 18 | public void setNotificationContent(String notificationContent) { 19 | this.notificationContent = notificationContent; 20 | } 21 | 22 | public long getId() { 23 | return id; 24 | } 25 | 26 | public void setId(long id) { 27 | this.id = id; 28 | } 29 | 30 | public String getTag() { 31 | return tag; 32 | } 33 | 34 | public void setTag(String tag) { 35 | this.tag = tag; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return "NotificationBean{" + 41 | ", notificationContent='" + notificationContent + '\'' + 42 | ",tag='"+tag+'\''+ 43 | '}'; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/bean/Resources.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.bean; 2 | 3 | import cn.bmob.v3.BmobObject; 4 | 5 | 6 | 7 | public class Resources extends BmobObject { 8 | 9 | /*** 10 | * 资源标题 11 | */ 12 | private String Title; 13 | 14 | /*** 15 | * 视频内容资源请求头类别 16 | */ 17 | private String httpstype; 18 | 19 | /*** 20 | * 视频封面图片请求类别 21 | */ 22 | private String coverhttptype; 23 | 24 | /*** 25 | *资源类型 26 | */ 27 | private String ContentType; 28 | 29 | /*** 30 | * 资源喜欢人数 31 | */ 32 | private String ContentLike; 33 | 34 | /*** 35 | * 资源视频内容请求id 36 | */ 37 | private String ContentId; 38 | 39 | /*** 40 | * 资源封面id 41 | */ 42 | private String Cover; 43 | 44 | /*** 45 | * 资源免费还是收费 46 | */ 47 | private String Authority; 48 | 49 | public Resources(String title, String httpstype, String coverhttptype, String contentType, String contentLike, String contentId, String authority, String cover) { 50 | Title = title; 51 | this.httpstype = httpstype; 52 | this.coverhttptype = coverhttptype; 53 | ContentType = contentType; 54 | ContentLike = contentLike; 55 | ContentId = contentId; 56 | Authority = authority; 57 | Cover = cover; 58 | } 59 | 60 | public String getTitle() { 61 | return Title; 62 | } 63 | 64 | public void setTitle(String title) { 65 | Title = title; 66 | } 67 | 68 | public String getHttpstype() { 69 | return httpstype; 70 | } 71 | 72 | public void setHttpstype(String httpstype) { 73 | this.httpstype = httpstype; 74 | } 75 | 76 | public String getContentType() { 77 | return ContentType; 78 | } 79 | 80 | public void setContentType(String contentType) { 81 | ContentType = contentType; 82 | } 83 | 84 | public String getContentLike() { 85 | return ContentLike; 86 | } 87 | 88 | public void setContentLike(String contentLike) { 89 | ContentLike = contentLike; 90 | } 91 | 92 | public String getContentId() { 93 | return ContentId; 94 | } 95 | 96 | public void setContentId(String contentId) { 97 | ContentId = contentId; 98 | } 99 | 100 | public String getAuthority() { 101 | return Authority; 102 | } 103 | 104 | public void setAuthority(String authority) { 105 | Authority = authority; 106 | } 107 | 108 | public String getCoverhttptype() { 109 | return coverhttptype; 110 | } 111 | 112 | public void setCoverhttptype(String coverhttptype) { 113 | this.coverhttptype = coverhttptype; 114 | } 115 | 116 | public String getCover() { 117 | return Cover; 118 | } 119 | 120 | public void setCover(String cover) { 121 | Cover = cover; 122 | } 123 | 124 | @Override 125 | public String toString() { 126 | return "Resources{" + 127 | "Title='" + Title + '\'' + 128 | ", httpstype='" + httpstype + '\'' + 129 | ", coverhttptype='" + coverhttptype + '\'' + 130 | ", ContentType='" + ContentType + '\'' + 131 | ", ContentLike='" + ContentLike + '\'' + 132 | ", ContentId='" + ContentId + '\'' + 133 | ", Authority='" + Authority + '\'' + 134 | ",cover='"+Cover+'\''+ 135 | '}'; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/bean/User.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.bean; 2 | 3 | 4 | import java.io.Serializable; 5 | 6 | import cn.bmob.v3.BmobObject; 7 | import cn.bmob.v3.datatype.BmobDate; 8 | 9 | 10 | public class User extends BmobObject implements Serializable { 11 | 12 | private String userAccount; 13 | 14 | private String userPassword; 15 | 16 | private Integer userHeadImg; 17 | 18 | private String memberLevel; 19 | 20 | private BmobDate memberStartDate; 21 | 22 | private BmobDate memberEndDate; 23 | 24 | private String userIMEI; 25 | 26 | private String userIntegral;//积分 27 | 28 | private String inviter;//邀请人账号 29 | 30 | public String getUserAccount() { 31 | return userAccount; 32 | } 33 | 34 | public void setUserAccount(String userAccount) { 35 | this.userAccount = userAccount; 36 | } 37 | 38 | public String getUserPassword() { 39 | return userPassword; 40 | } 41 | 42 | public void setUserPassword(String userPassword) { 43 | this.userPassword = userPassword; 44 | } 45 | 46 | public Integer getUserHeadImg() { 47 | return userHeadImg; 48 | } 49 | 50 | public void setUserHeadImg(Integer userHeadImg) { 51 | this.userHeadImg = userHeadImg; 52 | } 53 | 54 | public String getMemberLevel() { 55 | return memberLevel; 56 | } 57 | 58 | public void setMemberLevel(String memberLevel) { 59 | this.memberLevel = memberLevel; 60 | } 61 | 62 | public BmobDate getMemberStartDate() { 63 | return memberStartDate; 64 | } 65 | 66 | public void setMemberStartDate(BmobDate memberStartDate) { 67 | this.memberStartDate = memberStartDate; 68 | } 69 | 70 | public BmobDate getMemberEndDate() { 71 | return memberEndDate; 72 | } 73 | 74 | public void setMemberEndDate(BmobDate memberEndDate) { 75 | this.memberEndDate = memberEndDate; 76 | } 77 | 78 | 79 | public String getUserIMEI() { 80 | return userIMEI; 81 | } 82 | 83 | public void setUserIMEI(String userIMEI) { 84 | this.userIMEI = userIMEI; 85 | } 86 | 87 | public String getUserIntegral() { 88 | return userIntegral; 89 | } 90 | 91 | public void setUserIntegral(String userIntegral) { 92 | this.userIntegral = userIntegral; 93 | } 94 | 95 | public String getInviter() { 96 | return inviter; 97 | } 98 | 99 | public void setInviter(String inviter) { 100 | this.inviter = inviter; 101 | } 102 | 103 | @Override 104 | public String toString() { 105 | return "User{" + 106 | "userAccount='" + userAccount + '\'' + 107 | ", userPassword='" + userPassword + '\'' + 108 | ", userHeadImg='" + userHeadImg + '\'' + 109 | ", memberLevel='" + memberLevel + '\'' + 110 | ", memberStartDate=" + memberStartDate + 111 | ", memberEndDate=" + memberEndDate + 112 | ",userIMEI=" + userIMEI + 113 | ",userIntegral="+userIntegral+ 114 | ",inviter="+inviter+ 115 | '}'; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/CommonUtils.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.telephony.TelephonyManager; 8 | import android.text.TextUtils; 9 | import android.util.TypedValue; 10 | 11 | import com.hasee.pangci.X5.WebviewVideoActivity; 12 | 13 | 14 | public class CommonUtils { 15 | /** 16 | * 检查字符串是否为null or "" 17 | * @param str 需判断为空的字符串 18 | * @return 是否为空 19 | */ 20 | public static boolean checkStrIsNull(String... str) { 21 | for (int i = 0; i < str.length; i++) { 22 | if (TextUtils.isEmpty(str[i])) { 23 | return true; 24 | } 25 | } 26 | return false; 27 | } 28 | 29 | 30 | 31 | /** 32 | * 获取设备的唯一标识码IMEI 33 | * @param context 上下文环境 34 | * @return 获取到的设备IMEI码 35 | */ 36 | public static String getPhoneImei(Context context) { 37 | TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 38 | return telephonyManager.getDeviceId(); 39 | } 40 | 41 | 42 | /** 43 | * dp转px 44 | * @param dp 45 | * @param context 46 | * @return 47 | */ 48 | public static int dp2px(int dp,Context context){ 49 | return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,dp,context.getResources().getDisplayMetrics()); 50 | } 51 | 52 | public static void openURL(String url,Context context) { 53 | Intent intent = new Intent(); 54 | intent.setAction("android.intent.action.VIEW"); 55 | Uri content_url = Uri.parse(url); 56 | intent.setData(content_url); 57 | context.startActivity(intent); 58 | } 59 | 60 | public static void openURLToX5(String url,Context context) { 61 | Intent intent = new Intent(context, WebviewVideoActivity.class); 62 | intent.putExtra("url",url); 63 | context.startActivity(intent); 64 | } 65 | 66 | public static ProgressDialog buildProgressDialog(Context context){ 67 | ProgressDialog progressDialog = new ProgressDialog(context); 68 | progressDialog.setMessage("加载中..."); 69 | progressDialog.setCanceledOnTouchOutside(false); 70 | progressDialog.setCancelable(false); 71 | progressDialog.show(); 72 | return progressDialog; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/Constant.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | public class Constant { 4 | //Bmob配置信息 5 | public static final String BMOBAPPLICATIONID="508de0f2b5a9cd5e69b1921bb45f5cbd"; 6 | 7 | public static final String BMOBRESTAPIKEY="7698cafec3a09fdb70790dcc413b12e6"; 8 | 9 | public static final String BMOBSECRET="69295fd4c4937103"; 10 | 11 | public static final String BMOBMASTERKEY="73af0d13c31e3c8e2e9930ace19d235b"; 12 | 13 | public static final String ICONHEADERURL="http://api2.36cj.com/?vid="; 14 | //httptype 15 | //1 类 电影视频地址请求头 16 | public static final String MOVIEONEHEADERURL="https://bobo.kkpp.space/share/"; 17 | 18 | //0 类 电影视频地址请求头 19 | public static final String MOVIEZEROHEADERURL="http://api2.my230.com/?vid="; 20 | 21 | //2 类 电影视频地址请求头 //// TODO: 2017/9/16 待修改动漫的请求头 22 | public static final String MOVIETWOHEADERURL="http://api2.36cj.com/?vid="; 23 | 24 | 25 | //coverhttptype 26 | //0 类 电影图片地址请求头 带请求头 27 | public static final String ICONZEROHEADERURL="http://api2.my230.com/apitu.php?vid="; 28 | 29 | //1 类 电影图片是完整的请求头 不带请求头 30 | 31 | /** 32 | * 网盘资源请求头 33 | */ 34 | public static final String WPHEADERURL="http://pan.baidu.com/s/"; 35 | 36 | 37 | /*** 38 | * Bugly 39 | */ 40 | public static final String BUGLYAPPLICATIONID="59cf1fa7b5"; 41 | 42 | public static final String BUGLYAPPKEY="29314618-b31b-4017-9d69-6ba44ce47cfe"; 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/DateFormat.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | 8 | public class DateFormat { 9 | 10 | public static int differentDaysByMillisecond(String startTime, String endTime) { 11 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 12 | try { 13 | Date dateStart = format.parse(startTime); 14 | Date dateEnd = format.parse(endTime); 15 | int days = (int) ((dateEnd.getTime() - dateStart.getTime()) / (1000 * 3600 * 24)); 16 | return days; 17 | } catch (ParseException e) { 18 | e.printStackTrace(); 19 | } 20 | return 0; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | import com.hasee.pangci.bean.User; 4 | 5 | 6 | public class MessageEvent { 7 | 8 | private User mUser; 9 | private String flag; 10 | 11 | public MessageEvent(User mUser, String flag) { 12 | this.mUser = mUser; 13 | this.flag = flag; 14 | } 15 | 16 | public User getUser() { 17 | return mUser; 18 | } 19 | 20 | public void setUser(User user) { 21 | mUser = user; 22 | } 23 | 24 | public String getFlag() { 25 | return flag; 26 | } 27 | 28 | public void setFlag(String flag) { 29 | this.flag = flag; 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/MessageEvent2.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | 4 | 5 | public class MessageEvent2 { 6 | 7 | private String notice; 8 | 9 | public MessageEvent2(String notice) { 10 | this.notice = notice; 11 | } 12 | 13 | public String getNotice() { 14 | return notice; 15 | } 16 | 17 | public void setNotice(String notice) { 18 | this.notice = notice; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/MessageEventNotice.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | /** 4 | * Created by Administrator on 2017/9/27. 5 | */ 6 | 7 | public class MessageEventNotice { 8 | 9 | private String content; 10 | 11 | public MessageEventNotice(String content) { 12 | this.content = content; 13 | } 14 | 15 | public String getContent() { 16 | return content; 17 | } 18 | 19 | public void setContent(String content) { 20 | this.content = content; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/common/ViewUtil.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.common; 2 | 3 | 4 | import com.hasee.pangci.widget.Point; 5 | 6 | 7 | public class ViewUtil { 8 | /** 9 | * 两点之间的距离 10 | * 11 | * @param a 第一个点 12 | * @param b 第二个点 13 | * @return 距离 14 | */ 15 | public static double twoPointDistance(Point a, Point b) { 16 | //x轴差的平方加上y轴的平方,然后取平方根 17 | return Math.sqrt(Math.abs(a.x - b.x) * Math.abs(a.x - b.x) + Math.abs(a.y - b.y) * Math.abs(a.y - b.y)); 18 | } 19 | 20 | /** 21 | * 判断手指移动的坐标与点的坐标是否重合(默认小于点半径的一半的时候表示重合) 22 | * 23 | * @param pointX 点横坐标 24 | * @param pointY 点纵坐标 25 | * @param r 点半径 26 | * @param moveX 手指移动的横坐标 27 | * @param moveY 手指移动的纵坐标 28 | * @return 29 | */ 30 | public static boolean isCoincide(float pointX, float pointY, float r, float moveX, float moveY) { 31 | return Math.sqrt((pointX - moveX) * (pointX - moveX) + (pointY - moveY) * (pointY - moveY)) < r; 32 | } 33 | 34 | /** 35 | * 获取角度 36 | * 37 | * @param pointA 第一个点 38 | * @param pointB 第二个点 39 | * @return 40 | */ 41 | public static float getDegrees(Point pointA, Point pointB) { 42 | return (float) Math.toDegrees(Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/AnimeFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.app.ProgressDialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v7.widget.GridLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.adapter.CommonAdapter; 16 | import com.hasee.pangci.bean.Resources; 17 | import com.hasee.pangci.common.CommonUtils; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import butterknife.BindView; 23 | import butterknife.ButterKnife; 24 | import cn.bmob.v3.BmobQuery; 25 | import cn.bmob.v3.exception.BmobException; 26 | import cn.bmob.v3.listener.FindListener; 27 | 28 | 29 | public class AnimeFragment extends Fragment { 30 | private static final String TAG = "AnimeFragment"; 31 | private View mView; 32 | @BindView(R.id.rl_video_list) 33 | RecyclerView rlVideoList; 34 | private ArrayList mResourcesBeanArrayList = new ArrayList<>(); 35 | private static final String RESOURCETYPE = "anime"; 36 | private ProgressDialog mProgressDialog; 37 | 38 | 39 | @Nullable 40 | @Override 41 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 42 | if (mView != null) { 43 | ViewGroup parent = (ViewGroup) mView.getParent(); 44 | if (parent != null) { 45 | parent.removeView(mView); 46 | } 47 | ButterKnife.bind(this, mView); 48 | return mView; 49 | } 50 | mView = inflater.inflate(R.layout.member_fragment_layout, container, false); 51 | ButterKnife.bind(this, mView); 52 | return mView; 53 | } 54 | 55 | @Override 56 | public void onCreate(@Nullable Bundle savedInstanceState) { 57 | super.onCreate(savedInstanceState); 58 | //加载数据dialog 59 | mProgressDialog = CommonUtils.buildProgressDialog(getActivity()); 60 | } 61 | 62 | @Override 63 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 64 | super.onActivityCreated(savedInstanceState); 65 | //查询Anime类的资源 66 | if (mResourcesBeanArrayList.size() == 0) { 67 | BmobQuery bmobQuery = new BmobQuery<>(); 68 | bmobQuery.addWhereEqualTo("ContentType", RESOURCETYPE); 69 | //降序 70 | bmobQuery.order("-createdAt"); 71 | bmobQuery.setLimit(500); 72 | bmobQuery.findObjects(new FindListener() { 73 | @Override 74 | public void done(List list, BmobException e) { 75 | if (e == null) { 76 | for (int i = 0; i < list.size(); i++) { 77 | Resources resourcesBean = list.get(i); 78 | mResourcesBeanArrayList.add(resourcesBean); 79 | } 80 | CommonAdapter adapter = new CommonAdapter(mResourcesBeanArrayList, getActivity()); 81 | GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2); 82 | rlVideoList.setLayoutManager(gridLayoutManager); 83 | rlVideoList.setAdapter(adapter); 84 | //加载完成 85 | mProgressDialog.dismiss(); 86 | } else { 87 | Toast.makeText(getActivity(), "网络加载出错!", Toast.LENGTH_SHORT).show(); 88 | } 89 | } 90 | }); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/FeedBackFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.support.v4.app.Fragment; 8 | import android.text.TextUtils; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.EditText; 13 | import android.widget.Toast; 14 | 15 | import com.hasee.pangci.R; 16 | import com.hasee.pangci.bean.FeedBack; 17 | 18 | import butterknife.BindView; 19 | import butterknife.ButterKnife; 20 | import butterknife.OnClick; 21 | import cn.bmob.v3.exception.BmobException; 22 | import cn.bmob.v3.listener.SaveListener; 23 | 24 | public class FeedBackFragment extends Fragment { 25 | @BindView(R.id.feedback_content_et) 26 | EditText mContentEt; 27 | 28 | @OnClick(R.id.feedback_confirm_tv) 29 | public void onClick() { 30 | //获取当前用户 31 | SharedPreferences login_info = getActivity().getSharedPreferences("LOGIN_INFO", Context.MODE_PRIVATE); 32 | String userName = login_info.getString("account", ""); 33 | String content = mContentEt.getText().toString().trim(); 34 | if (!TextUtils.isEmpty(content)) { 35 | insertDataToDb(content, userName); 36 | } else { 37 | Toast.makeText(getActivity(), "内容不能为空!", Toast.LENGTH_SHORT).show(); 38 | } 39 | } 40 | 41 | private void insertDataToDb(String content, String userName) { 42 | FeedBack feedBack = new FeedBack(); 43 | feedBack.setContent(content); 44 | feedBack.setUserName(userName); 45 | feedBack.save(new SaveListener() { 46 | @Override 47 | public void done(String s, BmobException e) { 48 | if (e == null) { 49 | mContentEt.setText(""); 50 | Toast.makeText(getActivity(), "反馈成功,后台将在第一时间回复您.", Toast.LENGTH_SHORT).show(); 51 | }else { 52 | Toast.makeText(getActivity(), "反馈失败,请重试!", Toast.LENGTH_LONG).show(); 53 | } 54 | } 55 | }); 56 | } 57 | 58 | @Nullable 59 | @Override 60 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 61 | View view = inflater.inflate(R.layout.feedback_fragment_layout, container, false); 62 | ButterKnife.bind(this, view); 63 | return view; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/MemberFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.app.ProgressDialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v7.widget.GridLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.adapter.CommonAdapter; 16 | import com.hasee.pangci.bean.Resources; 17 | import com.hasee.pangci.common.CommonUtils; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import butterknife.BindView; 23 | import butterknife.ButterKnife; 24 | import cn.bmob.v3.BmobQuery; 25 | import cn.bmob.v3.exception.BmobException; 26 | import cn.bmob.v3.listener.FindListener; 27 | 28 | 29 | public class MemberFragment extends Fragment { 30 | private static final String TAG = "MemberFragment"; 31 | @BindView(R.id.rl_video_list) 32 | RecyclerView rlVideoList; 33 | private ArrayList mResourcesBeanArrayList = new ArrayList<>(); 34 | private static final String RESOURCETYPE = "vip"; 35 | private View mView; 36 | private ProgressDialog mProgressDialog; 37 | 38 | @Nullable 39 | @Override 40 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 41 | if (mView != null) { 42 | ViewGroup parent = (ViewGroup) mView.getParent(); 43 | if (parent != null) { 44 | parent.removeView(mView); 45 | } 46 | ButterKnife.bind(this,mView); 47 | return mView; 48 | } 49 | mView = inflater.inflate(R.layout.member_fragment_layout, container, false); 50 | ButterKnife.bind(this, mView); 51 | return mView; 52 | } 53 | 54 | @Override 55 | public void onCreate(@Nullable Bundle savedInstanceState) { 56 | super.onCreate(savedInstanceState); 57 | mProgressDialog = CommonUtils.buildProgressDialog(getActivity());//加载数据dialog 58 | } 59 | 60 | @Override 61 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 62 | super.onActivityCreated(savedInstanceState); 63 | //查询vip类的资源 64 | if (mResourcesBeanArrayList.size() == 0) { 65 | BmobQuery bmobQuery = new BmobQuery<>(); 66 | bmobQuery.addWhereEqualTo("ContentType", RESOURCETYPE); 67 | bmobQuery.order("-createdAt");//降序 68 | bmobQuery.setLimit(500); 69 | bmobQuery.findObjects(new FindListener() { 70 | @Override 71 | public void done(List list, BmobException e) { 72 | if (e == null) { 73 | for (int i = 0; i < list.size(); i++) { 74 | Resources resourcesBean = list.get(i); 75 | mResourcesBeanArrayList.add(resourcesBean); 76 | } 77 | CommonAdapter adapter = new CommonAdapter(mResourcesBeanArrayList, getActivity()); 78 | GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2); 79 | rlVideoList.setLayoutManager(gridLayoutManager); 80 | rlVideoList.setAdapter(adapter); 81 | mProgressDialog.dismiss();//加载完成 82 | } else { 83 | Toast.makeText(getActivity(), "网络加载出错!", Toast.LENGTH_SHORT).show(); 84 | } 85 | } 86 | }); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/MovieFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.app.ProgressDialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v7.widget.GridLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.adapter.CommonAdapter; 16 | import com.hasee.pangci.bean.Resources; 17 | import com.hasee.pangci.common.CommonUtils; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import butterknife.BindView; 23 | import butterknife.ButterKnife; 24 | import cn.bmob.v3.BmobQuery; 25 | import cn.bmob.v3.exception.BmobException; 26 | import cn.bmob.v3.listener.FindListener; 27 | 28 | public class MovieFragment extends Fragment { 29 | private static final String TAG = "MovieFragment"; 30 | @BindView(R.id.rl_video_list) 31 | RecyclerView rlVideoList; 32 | private ArrayList mResourcesBeanArrayList = new ArrayList<>(); 33 | private static final String RESOURCETYPE = "video"; 34 | private View mView; 35 | private ProgressDialog mProgressDialog; 36 | 37 | @Nullable 38 | @Override 39 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 40 | if (mView != null) { 41 | ViewGroup parent = (ViewGroup) mView.getParent(); 42 | if (parent != null) { 43 | parent.removeView(mView); 44 | } 45 | ButterKnife.bind(this, mView); 46 | return mView; 47 | } 48 | mView = inflater.inflate(R.layout.movie_fragment_layout, container, false); 49 | ButterKnife.bind(this, mView); 50 | return mView; 51 | } 52 | 53 | @Override 54 | public void onCreate(@Nullable Bundle savedInstanceState) { 55 | super.onCreate(savedInstanceState); 56 | mProgressDialog = CommonUtils.buildProgressDialog(getActivity());//加载数据dialog 57 | } 58 | 59 | 60 | @Override 61 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 62 | super.onActivityCreated(savedInstanceState); 63 | //查询电影类的资源 64 | if (mResourcesBeanArrayList.size() == 0) { 65 | BmobQuery bmobQuery = new BmobQuery<>(); 66 | bmobQuery.addWhereEqualTo("ContentType", RESOURCETYPE); 67 | bmobQuery.order("-createdAt");//降序 68 | bmobQuery.setLimit(500); 69 | bmobQuery.findObjects(new FindListener() { 70 | @Override 71 | public void done(List list, BmobException e) { 72 | if (e == null) { 73 | for (int i = 0; i < list.size(); i++) { 74 | Resources resourcesBean = list.get(i); 75 | mResourcesBeanArrayList.add(resourcesBean); 76 | } 77 | CommonAdapter adapter = new CommonAdapter(mResourcesBeanArrayList, getActivity()); 78 | GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2); 79 | rlVideoList.setLayoutManager(gridLayoutManager); 80 | rlVideoList.setAdapter(adapter); 81 | mProgressDialog.dismiss();//加载完成 82 | } else { 83 | Toast.makeText(getActivity(), "网络加载出错!", Toast.LENGTH_SHORT).show(); 84 | } 85 | } 86 | }); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/NetdiskFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.app.ProgressDialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v7.widget.GridLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.Toast; 13 | 14 | import com.hasee.pangci.R; 15 | import com.hasee.pangci.adapter.CommonAdapter; 16 | import com.hasee.pangci.bean.Resources; 17 | import com.hasee.pangci.common.CommonUtils; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import butterknife.BindView; 23 | import butterknife.ButterKnife; 24 | import cn.bmob.v3.BmobQuery; 25 | import cn.bmob.v3.exception.BmobException; 26 | import cn.bmob.v3.listener.FindListener; 27 | 28 | 29 | public class NetdiskFragment extends Fragment { 30 | private static final String TAG = "NetdiskFragment"; 31 | private View mView; 32 | @BindView(R.id.rl_video_list) 33 | RecyclerView rlVideoList; 34 | private ArrayList mResourcesBeanArrayList = new ArrayList<>(); 35 | private static final String RESOURCETYPE = "netdisk"; 36 | private ProgressDialog mProgressDialog; 37 | 38 | @Nullable 39 | @Override 40 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 41 | if (mView != null) { 42 | ViewGroup parent = (ViewGroup) mView.getParent(); 43 | if (parent != null) { 44 | parent.removeView(mView); 45 | } 46 | ButterKnife.bind(this, mView); 47 | return mView; 48 | } 49 | mView = inflater.inflate(R.layout.member_fragment_layout, container, false); 50 | ButterKnife.bind(this, mView); 51 | return mView; 52 | } 53 | 54 | @Override 55 | public void onCreate(@Nullable Bundle savedInstanceState) { 56 | super.onCreate(savedInstanceState); 57 | mProgressDialog = CommonUtils.buildProgressDialog(getActivity());//加载数据dialog 58 | } 59 | 60 | @Override 61 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 62 | super.onActivityCreated(savedInstanceState); 63 | //查询Anime类的资源 64 | if (mResourcesBeanArrayList.size() == 0) { 65 | BmobQuery bmobQuery = new BmobQuery<>(); 66 | bmobQuery.addWhereEqualTo("ContentType", RESOURCETYPE); 67 | bmobQuery.order("-createdAt");//降序 68 | bmobQuery.setLimit(500); 69 | bmobQuery.findObjects(new FindListener() { 70 | @Override 71 | public void done(List list, BmobException e) { 72 | if (e == null) { 73 | for (int i = 0; i < list.size(); i++) { 74 | Resources resourcesBean = list.get(i); 75 | mResourcesBeanArrayList.add(resourcesBean); 76 | } 77 | CommonAdapter adapter = new CommonAdapter(mResourcesBeanArrayList, getActivity()); 78 | GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2); 79 | rlVideoList.setLayoutManager(gridLayoutManager); 80 | rlVideoList.setAdapter(adapter); 81 | mProgressDialog.dismiss();//加载完成 82 | } else { 83 | Toast.makeText(getActivity(), "网络加载出错!", Toast.LENGTH_SHORT).show(); 84 | } 85 | } 86 | }); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/fragment/NotificationFragment.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.fragment; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.support.design.widget.FloatingActionButton; 8 | import android.support.design.widget.Snackbar; 9 | import android.support.v4.app.Fragment; 10 | import android.support.v7.widget.DefaultItemAnimator; 11 | import android.support.v7.widget.LinearLayoutManager; 12 | import android.support.v7.widget.RecyclerView; 13 | import android.view.LayoutInflater; 14 | import android.view.View; 15 | import android.view.ViewGroup; 16 | import android.widget.RelativeLayout; 17 | 18 | import com.hasee.pangci.common.MessageEvent; 19 | import com.hasee.pangci.R; 20 | import com.hasee.pangci.adapter.NotificationAdapter; 21 | import com.hasee.pangci.bean.NotificationBean; 22 | import com.hasee.pangci.interfaces.RecyclerItemOnClickListener; 23 | 24 | import org.greenrobot.eventbus.EventBus; 25 | import org.greenrobot.eventbus.Subscribe; 26 | import org.greenrobot.eventbus.ThreadMode; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | import butterknife.BindView; 32 | import butterknife.ButterKnife; 33 | 34 | 35 | public class NotificationFragment extends Fragment implements RecyclerItemOnClickListener { 36 | @BindView(R.id.notification_recycler_view) 37 | RecyclerView mRecyclerView; 38 | @BindView(R.id.notification_fab) 39 | FloatingActionButton mFloatingActionButton; 40 | @BindView(R.id.noti_normal_rl) 41 | RelativeLayout mRelativeLayout; 42 | private ArrayList notificationBeanArrayList = new ArrayList<>(); 43 | private NotificationAdapter notificationAdapter; 44 | 45 | @Nullable 46 | @Override 47 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 48 | View view = inflater.inflate(R.layout.notification_fragment_layout, container, false); 49 | ButterKnife.bind(this, view); 50 | EventBus.getDefault().register(this); 51 | mFloatingActionButton.setOnClickListener(new View.OnClickListener() { 52 | @Override 53 | public void onClick(View v) { 54 | Snackbar.make(mRecyclerView, "长按删除消息!", Snackbar.LENGTH_LONG).show(); 55 | } 56 | }); 57 | return view; 58 | } 59 | 60 | @Override 61 | public void onStart() { 62 | super.onStart(); 63 | if (notificationBeanArrayList.size() != 0) { 64 | mRelativeLayout.setVisibility(View.GONE); 65 | } 66 | } 67 | 68 | @Override 69 | public void onActivityCreated(@Nullable Bundle savedInstanceState) { 70 | super.onActivityCreated(savedInstanceState); 71 | if (notificationBeanArrayList.size() == 0) { 72 | List all = NotificationBean.findAll(NotificationBean.class); 73 | notificationBeanArrayList.addAll(all); 74 | mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false)); 75 | mRecyclerView.setItemAnimator(new DefaultItemAnimator()); 76 | notificationAdapter = new NotificationAdapter(notificationBeanArrayList, getActivity()); 77 | mRecyclerView.setAdapter(notificationAdapter); 78 | notificationAdapter.setRecyclerItemOnClickListener(this); 79 | if (notificationBeanArrayList.size() != 0) { 80 | mRecyclerView.smoothScrollToPosition(notificationBeanArrayList.size() - 1); 81 | } 82 | } 83 | } 84 | 85 | @Subscribe(threadMode = ThreadMode.MAIN) 86 | public void handleEvent(MessageEvent messageEvent) { 87 | if (!"receiver".equals(messageEvent.getFlag())) { 88 | return; 89 | } 90 | //再查一次数据库 91 | notificationBeanArrayList.clear(); 92 | List all = NotificationBean.findAll(NotificationBean.class); 93 | notificationBeanArrayList.addAll(all); 94 | notificationAdapter.notifyDataSetChanged(); 95 | 96 | if (notificationBeanArrayList.size() != 0) { 97 | mRelativeLayout.setVisibility(View.GONE); 98 | } 99 | } 100 | 101 | @Override 102 | public void onDestroyView() { 103 | super.onDestroyView(); 104 | EventBus.getDefault().unregister(this); 105 | } 106 | 107 | @Override 108 | public void onItemLongClick(int position) { 109 | NotificationBean notificationBean = notificationBeanArrayList.get(position); 110 | NotificationBean.delete(NotificationBean.class, notificationBean.getId()); 111 | notificationBeanArrayList.remove(position); 112 | notificationAdapter.notifyDataSetChanged(); 113 | if (notificationBeanArrayList.size() == 0) { 114 | mRelativeLayout.setVisibility(View.VISIBLE); 115 | } 116 | } 117 | 118 | @Override 119 | public void onItemClick(int position) { 120 | NotificationBean notificationBean = notificationBeanArrayList.get(position); 121 | String notificationContent = notificationBean.getNotificationContent(); 122 | int indexOf = notificationContent.indexOf(":"); 123 | String substring = notificationContent.substring(indexOf + 1, notificationContent.length());//包前不包后 124 | if ("1".equals(notificationBean.getTag())) { 125 | Intent intent = new Intent(); 126 | intent.setAction("android.intent.action.VIEW"); 127 | Uri content_url = Uri.parse(substring); 128 | intent.setData(content_url); 129 | startActivity(intent); 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/interfaces/RecyclerItemOnClickListener.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.interfaces; 2 | 3 | /** 4 | * @author 5 | */ 6 | public interface RecyclerItemOnClickListener { 7 | /** 8 | * 列表长按的回调方法 9 | * @param position 长按的列表项 10 | */ 11 | void onItemLongClick(int position); 12 | 13 | /*** 14 | * 列表点击的回调方法 15 | * @param position 单击的列表item 16 | */ 17 | void onItemClick(int position); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/permission/PermissionListener.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.permission; 2 | 3 | /**权限监听器 4 | * @class PermissionListener 5 | * @author 6 | * @date 2016-3-28-下午2:42:05 7 | */ 8 | public interface PermissionListener { 9 | /** 10 | * 用户授权后调用 11 | */ 12 | public void onGranted(); 13 | 14 | /** 15 | * 用户禁止后调用 16 | */ 17 | public void onDenied(); 18 | 19 | /**是否显示阐述性说明 20 | * @param permissions 返回需要显示说明的权限数组 21 | */ 22 | public void onShowRationale(String[] permissions); 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/permission/PermissionManager.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.permission; 2 | 3 | import android.app.Activity; 4 | import android.content.pm.PackageManager; 5 | import android.support.v4.app.ActivityCompat; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v4.content.ContextCompat; 8 | 9 | import java.util.ArrayList; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * 权限管理 16 | * @author 17 | * @class PermissionManager 18 | * @date 2016-3-25 下午3:54:14 19 | */ 20 | public class PermissionManager { 21 | 22 | private Object mObject; 23 | private String[] mPermissions; 24 | private int mRequestCode; 25 | private PermissionListener mListener; 26 | // 用户是否确认了解释框的 27 | private boolean mIsPositive = false; 28 | 29 | public static PermissionManager with(Activity activity) { 30 | return new PermissionManager(activity); 31 | } 32 | 33 | public static PermissionManager with(Fragment fragment) { 34 | return new PermissionManager(fragment); 35 | } 36 | 37 | public PermissionManager permissions(String... permissions) { 38 | this.mPermissions = permissions; 39 | return this; 40 | } 41 | 42 | public PermissionManager addRequestCode(int requestCode) { 43 | this.mRequestCode = requestCode; 44 | return this; 45 | } 46 | 47 | public PermissionManager setPermissionsListener(PermissionListener listener) { 48 | this.mListener = listener; 49 | return this; 50 | } 51 | 52 | public PermissionManager(Object object) { 53 | this.mObject = object; 54 | } 55 | 56 | /**请求权限 57 | * @return PermissionManager 58 | */ 59 | public PermissionManager request() { 60 | request(mObject, mPermissions, mRequestCode); 61 | return this; 62 | } 63 | 64 | private void request(Object object, String[] permissions, int requestCode) { 65 | // 根据权限集合去查找是否已经授权过 66 | Map> map = findDeniedPermissions(getActivity(object), permissions); 67 | List deniedPermissions = map.get("deny"); 68 | List rationales = map.get("rationale"); 69 | if (deniedPermissions.size() > 0) { 70 | // 第一次点击deny才调用,mIsPositive是为了防止点确认解释框后调request()递归调onShowRationale 71 | if (rationales.size() > 0 && mIsPositive == false) { 72 | if (mListener != null ) { 73 | mListener.onShowRationale(rationales.toArray(new String[rationales.size()])); 74 | } 75 | return; 76 | } 77 | if (object instanceof Activity) { 78 | ActivityCompat.requestPermissions((Activity) object, deniedPermissions.toArray(new String[deniedPermissions.size()]), requestCode); 79 | } else if (object instanceof Fragment) { 80 | ((Fragment) object).requestPermissions(deniedPermissions.toArray(new String[deniedPermissions.size()]), requestCode); 81 | } else { 82 | throw new IllegalArgumentException(object.getClass().getName() + " is not supported"); 83 | } 84 | } else { 85 | if (mListener != null) { 86 | mListener.onGranted(); 87 | } 88 | } 89 | } 90 | 91 | /**根据requestCode处理响应的权限 92 | * @param permissions 93 | * @param results 94 | */ 95 | public void onPermissionResult(String[] permissions, int[] results) { 96 | List deniedPermissions = new ArrayList(); 97 | for (int i = 0; i < results.length; i++) { 98 | //未授权 99 | if (results[i] != PackageManager.PERMISSION_GRANTED) { 100 | deniedPermissions.add(permissions[i]); 101 | } 102 | } 103 | if (deniedPermissions.size() > 0) { 104 | if (mListener != null) { 105 | mListener.onDenied(); 106 | } 107 | } else { 108 | if (mListener != null) { 109 | mListener.onGranted(); 110 | } 111 | } 112 | } 113 | 114 | private Map> findDeniedPermissions(Activity activity, String... permissions) { 115 | Map> map = new HashMap>(); 116 | //未授权的权限 117 | List denyList = new ArrayList(); 118 | //需要显示提示框的权限 119 | List rationaleList = new ArrayList(); 120 | for (String value : permissions) { 121 | if (ContextCompat.checkSelfPermission(activity, value) != PackageManager.PERMISSION_GRANTED) { 122 | denyList.add(value); 123 | if (shouldShowRequestPermissionRationale(value)) { 124 | rationaleList.add(value); 125 | } 126 | } 127 | } 128 | map.put("deny", denyList); 129 | map.put("rationale", rationaleList); 130 | return map; 131 | } 132 | 133 | private Activity getActivity(Object object) { 134 | if (object instanceof Fragment) { 135 | return ((Fragment) object).getActivity(); 136 | } else if (object instanceof Activity) { 137 | return (Activity) object; 138 | } 139 | return null; 140 | } 141 | 142 | /** 143 | * 当用户拒绝某权限时并点击就不再提醒的按钮时,下次应用再请求该权限时,需要给出合适的响应(比如给个展示对话框) 144 | * @param permission 具体权限 145 | */ 146 | private boolean shouldShowRequestPermissionRationale(String permission) { 147 | if (mObject instanceof Activity) { 148 | return ActivityCompat.shouldShowRequestPermissionRationale((Activity) mObject, permission); 149 | } else if (mObject instanceof Fragment) { 150 | return ((Fragment) mObject).shouldShowRequestPermissionRationale(permission); 151 | } else { 152 | throw new IllegalArgumentException(mObject.getClass().getName() + " is not supported"); 153 | } 154 | } 155 | 156 | public void setIsPositive(boolean isPositive) { 157 | this.mIsPositive = isPositive; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/receiver/MyPushMessageReceiver.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.receiver; 2 | 3 | import android.app.Notification; 4 | import android.app.NotificationManager; 5 | import android.app.PendingIntent; 6 | import android.content.BroadcastReceiver; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | import android.content.SharedPreferences; 10 | import android.graphics.BitmapFactory; 11 | import android.net.Uri; 12 | import android.support.v4.app.NotificationCompat; 13 | 14 | import com.hasee.pangci.common.MessageEvent; 15 | import com.hasee.pangci.common.MessageEvent2; 16 | import com.hasee.pangci.common.MessageEventNotice; 17 | import com.hasee.pangci.R; 18 | import com.hasee.pangci.activity.LoginActivity; 19 | import com.hasee.pangci.activity.NotificationActivity; 20 | import com.hasee.pangci.bean.NotificationBean; 21 | import com.hasee.pangci.bean.User; 22 | 23 | import org.greenrobot.eventbus.EventBus; 24 | import org.json.JSONException; 25 | import org.json.JSONObject; 26 | 27 | import cn.bmob.push.PushConstants; 28 | 29 | public class MyPushMessageReceiver extends BroadcastReceiver { 30 | private static final String NORMAL = "0"; 31 | private static final String LINK = "1"; 32 | private static final String ACTION = "2"; //活动与公告的推送 33 | 34 | @Override 35 | public void onReceive(Context context, Intent intent) { 36 | if (intent.getAction().equals(PushConstants.ACTION_MESSAGE)) { 37 | try { 38 | JSONObject jsonObject = new JSONObject(intent.getStringExtra("msg")); 39 | String tag = jsonObject.getString("tag"); 40 | String title = jsonObject.getString("title"); 41 | String content = jsonObject.getString("content"); 42 | 43 | //数据插到本地数据库 44 | if (tag.equals(ACTION)) { 45 | //通知主页公告栏显示活动详情 46 | EventBus.getDefault().post(new MessageEvent2(content)); 47 | } else { 48 | NotificationBean notificationBean = new NotificationBean(); 49 | notificationBean.setTag(tag); 50 | notificationBean.setNotificationContent(content); 51 | notificationBean.save(); 52 | EventBus.getDefault().post(new MessageEvent(new User(), "receiver")); 53 | buildNotification(context, content, title, tag); 54 | 55 | //通知栏显示的同时顶部也显示会不会有点多余呢? 56 | EventBus.getDefault().post(new MessageEventNotice(content)); 57 | } 58 | } catch (JSONException e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | } 63 | 64 | private void buildNotification(Context context, String content, String title, String tag) { 65 | Intent intent = null; 66 | SharedPreferences login_info = context.getSharedPreferences("LOGIN_INFO", Context.MODE_PRIVATE); 67 | boolean isLogin = login_info.getBoolean("isLogin", false); 68 | if (!isLogin) { 69 | intent = new Intent(context, LoginActivity.class); 70 | } else { 71 | //登录的情况 区分普通推送与链接推送 72 | if (tag.equals(NORMAL)) { 73 | //普通消息推送 74 | intent = new Intent(context, NotificationActivity.class); 75 | } else { 76 | //资源推送 77 | intent = new Intent(); 78 | intent.setAction("android.intent.action.VIEW"); 79 | Uri content_url = Uri.parse(content); 80 | intent.setData(content_url); 81 | } 82 | } 83 | PendingIntent pi = PendingIntent.getActivity(context, 0, intent, 0); 84 | NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 85 | Notification notification = new NotificationCompat.Builder(context) 86 | .setContentTitle(title) 87 | .setContentText(content) 88 | .setWhen(System.currentTimeMillis()) 89 | .setSmallIcon(R.drawable.logo) 90 | .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.logo)) 91 | .setContentIntent(pi) 92 | .setAutoCancel(true)//设置点击后消失 93 | .setDefaults(NotificationCompat.DEFAULT_SOUND) 94 | .setPriority(NotificationCompat.PRIORITY_MAX) 95 | .build(); 96 | manager.notify(1, notification); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/widget/FadeInTextView.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.widget; 2 | 3 | import android.animation.ValueAnimator; 4 | import android.content.Context; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.graphics.Rect; 8 | import android.support.annotation.Nullable; 9 | import android.support.v7.widget.AppCompatTextView; 10 | import android.util.AttributeSet; 11 | import android.view.animation.LinearInterpolator; 12 | 13 | /** 14 | * Created by Administrator on 2017/9/27. 15 | */ 16 | 17 | public class FadeInTextView extends AppCompatTextView { 18 | 19 | private Rect textRect = new Rect(); 20 | 21 | private StringBuffer stringBuffer = new StringBuffer(); 22 | 23 | private String[] arr; 24 | 25 | private int textCount; 26 | 27 | private int currentIndex = -1; 28 | 29 | /** 30 | * 每个字出现的时间 31 | */ 32 | private int duration = 300; 33 | private ValueAnimator textAnimation; 34 | 35 | private TextAnimationListener textAnimationListener; 36 | 37 | 38 | public FadeInTextView setTextAnimationListener(TextAnimationListener textAnimationListener) { 39 | this.textAnimationListener = textAnimationListener; 40 | return this; 41 | } 42 | 43 | public FadeInTextView(Context context) { 44 | this(context, null); 45 | } 46 | 47 | public FadeInTextView(Context context, @Nullable AttributeSet attrs) { 48 | super(context, attrs); 49 | 50 | } 51 | 52 | @Override 53 | protected void onDraw(final Canvas canvas) { 54 | super.onDraw(canvas); 55 | // 使用setText代替重绘就不用自己去绘制text了 56 | // if (stringBuffer != null) { 57 | // drawText(canvas, stringBuffer.toString()); 58 | // } 59 | } 60 | 61 | /** 62 | * 绘制文字 63 | * 64 | * @param canvas 画布 65 | */ 66 | private void drawText(Canvas canvas, String textString) { 67 | textRect.left = getPaddingLeft(); 68 | textRect.top = getPaddingTop(); 69 | textRect.right = getWidth() - getPaddingRight(); 70 | textRect.bottom = getHeight() - getPaddingBottom(); 71 | Paint.FontMetricsInt fontMetrics = getPaint().getFontMetricsInt(); 72 | int baseline = (textRect.bottom + textRect.top - fontMetrics.bottom - fontMetrics.top) / 2; 73 | //文字绘制到整个布局的中心位置 74 | canvas.drawText(textString, getPaddingLeft(), baseline, getPaint()); 75 | } 76 | 77 | /** 78 | * 文字逐个显示动画 通过插值的方式改变数据源 79 | */ 80 | private void initAnimation() { 81 | 82 | //从0到textCount - 1 是设置从第一个字到最后一个字的变化因子 83 | textAnimation = ValueAnimator.ofInt(0, textCount - 1); 84 | //执行总时间就是每个字的时间乘以字数 85 | textAnimation.setDuration(textCount * duration); 86 | //匀速显示文字 87 | textAnimation.setInterpolator(new LinearInterpolator()); 88 | textAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { 89 | @Override 90 | public void onAnimationUpdate(ValueAnimator valueAnimator) { 91 | int index = (int) valueAnimator.getAnimatedValue(); 92 | //过滤去重,保证每个字只重绘一次 93 | if (currentIndex != index) { 94 | stringBuffer.append(arr[index]); 95 | currentIndex = index; 96 | //所有文字都显示完成之后进度回调结束动画 97 | if (currentIndex == (textCount - 1)) { 98 | if (textAnimationListener != null) { 99 | textAnimationListener.animationFinish(); 100 | } 101 | } 102 | 103 | //新思路的做法 104 | setText(stringBuffer.toString()); 105 | 106 | /** 107 | * 之前的做法刷新重绘text,需要自己控制文字的绘制, 108 | * 看到网友的评论开拓了思路,既然是直接集成TextView 109 | * 就可以直接使用setText()方法进行设置值了 110 | */ 111 | //invalidate();老思路的做法 112 | } 113 | } 114 | }); 115 | } 116 | 117 | /** 118 | * 设置逐渐显示的字符串 119 | * 120 | * @param textString 121 | * @return 122 | */ 123 | public FadeInTextView setTextString(String textString) { 124 | if (textString != null) { 125 | //总字数 126 | textCount = textString.length(); 127 | //存放单个字的数组 128 | arr = new String[textCount]; 129 | for (int i = 0; i < textCount; i++) { 130 | arr[i] = textString.substring(i, i + 1); 131 | } 132 | initAnimation(); 133 | } 134 | 135 | return this; 136 | } 137 | 138 | /** 139 | * 开启动画 140 | * 141 | * @return 142 | */ 143 | public FadeInTextView startFadeInAnimation() { 144 | if (textAnimation != null) { 145 | stringBuffer.setLength(0); 146 | currentIndex = -1; 147 | textAnimation.start(); 148 | } 149 | return this; 150 | } 151 | 152 | /** 153 | * 停止动画 154 | * 155 | * @return 156 | */ 157 | public FadeInTextView stopFadeInAnimation() { 158 | if (textAnimation != null) { 159 | textAnimation.end(); 160 | } 161 | return this; 162 | } 163 | 164 | /** 165 | * 回调接口 166 | */ 167 | public interface TextAnimationListener { 168 | /** 169 | * 动画结束后的回调 170 | */ 171 | void animationFinish(); 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /app/src/main/java/com/hasee/pangci/widget/Point.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci.widget; 2 | 3 | /** 4 | * 自定义的Point 5 | * Created by Jack on 16/10/12. 6 | */ 7 | public class Point { 8 | 9 | //正常状态 10 | public static int STATE_NORMAL = 0; 11 | //选中状态 12 | public static int STATE_PRESSED = 1; 13 | //错误状态 14 | public static int STATE_ERROR = 2; 15 | 16 | public float x, y; 17 | 18 | public int index = 0, status = 0; 19 | 20 | public Point() { 21 | 22 | } 23 | 24 | public Point(float x, float y) { 25 | this.x = x; 26 | this.y = y; 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/account.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/cache.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/change.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/delete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/exit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/flock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/flock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_22.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_22_hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_22_hide.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_33.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_33_hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_33_hide.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar10.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar11.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar5.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar6.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar7.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar8.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_avatar9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_avatar9.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_navigation_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_navigation_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_upper_loading_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/ic_upper_loading_failed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_back_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/icon_back_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/integral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/integral.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/inviter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/inviter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/lock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/logo_text.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/look.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/look.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/member.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/my_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/my_info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/normal_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/normal_login.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/not_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/not_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/notification_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/notification_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_slid_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/open_slid_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/password.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/play_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/play_ico.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/recommend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/recommend.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/splash_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/splash_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/version.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/vip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/vip.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/weixing_zhifu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/weixing_zhifu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/yuan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable-xxhdpi/yuan.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_text_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_register_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_register_text_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_text_bg_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/exit_alter_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/integral_tv_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/kefu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/kefu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/line_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/line_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/line_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/line_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/login_button_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/message_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/my_order_return_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/point_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/point_error.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/point_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/point_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/point_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/drawable/point_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/register_button_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/verify_dialog_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_lock.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | 20 | 21 | 29 | 30 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 22 | 23 | 24 | 30 | 31 | 39 | 40 | 46 | 47 | 48 | 56 | 57 | 58 | 59 | 60 | 68 | 69 | 74 | 79 | 80 | 91 | 92 | 93 | 94 | 100 | 101 | 102 | 103 | 111 | 112 | 117 | 122 | 123 | 135 | 136 | 137 | 138 | 144 | 145 | 146 | 147 | 155 | 156 | 168 | 169 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 19 | 20 | 29 | 30 | 31 | 41 | 42 | 43 | 44 | 45 | 46 | 51 | 52 | 53 | 54 | 59 | 60 | 61 | 62 | 73 | 74 | 82 | 83 | 84 | 85 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_notification.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_verify_lock.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 15 | 22 | 23 | 28 | 29 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_webview_video.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 12 | 23 | 26 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_activity_rule.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 21 | 22 | 25 | 26 | 34 | 35 | 40 | 41 | 42 | 43 | 49 | 54 | 66 | 77 | 88 | 99 | 104 | 105 | 106 | 107 | 108 | 109 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_activity_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 21 | 22 | 25 | 26 | 34 | 35 | 40 | 41 | 42 | 43 | 49 | 54 | 65 | 76 | 77 | 82 | 83 | 84 | 85 | 86 | 87 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /app/src/main/res/layout/feedback_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 23 | 24 | 35 | 36 | 37 | 38 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_notification_recycler_view_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 26 | 27 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/join_netdisk_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 29 | 30 | 42 | 43 | 55 | 56 | 68 | 69 | 70 | 77 | 78 | 84 | 85 | 95 | 96 | 101 | 102 | 103 | 104 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /app/src/main/res/layout/member_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/movie_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigation_view_header_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 29 | 30 | 31 | 40 | 41 | 48 | 49 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notice.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 21 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notice_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 25 | 26 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notification_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 23 | 24 | 32 | 33 | 34 | 35 | 38 | 39 | 43 | 44 | 45 | 46 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/layout/pay_dialog_hint.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 28 | 29 | 41 | 42 | 55 | 56 | 68 | 69 | 76 | 77 | 83 | 84 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /app/src/main/res/layout/play_dialog_hint.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 28 | 29 | 36 | 37 | 43 | 44 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recommend_fragment_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/upgrade_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 20 | 21 | 26 | 27 | 28 | 39 | 40 | 44 | 45 | 49 | 50 | 55 | 56 | 63 | 64 | 71 | 72 | 79 | 80 | 81 | 82 | 86 | 87 | 98 | 99 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /app/src/main/res/layout/verify_dialog_hint.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 25 | 26 | 33 | 34 | 45 | 46 | 60 | 61 | 69 | 70 | 76 | 77 | 86 | 87 | 92 | 93 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /app/src/main/res/layout/video_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 17 | 18 | 24 | 25 | 32 | 33 | 41 | 42 | 53 | 54 | 70 | 71 | 72 | 73 | 84 | 85 | 92 | 93 | -------------------------------------------------------------------------------- /app/src/main/res/menu/lock_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/login_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/navigation_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 39 | 40 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaochengbiao/pangci/022b9f534d8de54152824a43a051432dfbedebbf/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FA7298 4 | #FA7298 5 | #FA7298 6 | #FFFFFF 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 胖次 3 | 福利来啦,充值白金会员即可获赠25元的爱奇艺会员一个月(唯一使用,不是分享号哦) 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | //toolBar的文字大小颜色 19 | 23 | 24 | //toolBar菜单的颜色和文字 25 | 29 | 30 | //启动白屏 31 | 37 | 41 | 42 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/test/java/com/hasee/pangci/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.hasee.pangci; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | //Bmob的maven仓库地址--必填 19 | maven { url "https://raw.github.com/bmob/bmob-android-sdk/master" } 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 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-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /text: -------------------------------------------------------------------------------- 1 | 胖次应用知识点:1.基于安卓5.0Material Design设计风格编写 2.后台服务器集成bmob 3.采用极光推送 4.采用腾讯x5浏览器 5.bugly版本更新 6.手势密码保护隐私 7.常见控件和布局 实现功能:1.常规注册和登录 2.会员权限等级控制 3.邀请积分制 4.视频播放 2 | --------------------------------------------------------------------------------