├── .gitignore
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── coalreport
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── coalreport
│ │ │ ├── MainActivity.java
│ │ │ ├── MyApp.java
│ │ │ ├── about
│ │ │ └── AboutActivity.java
│ │ │ ├── adapter
│ │ │ ├── HomeAdapter.java
│ │ │ ├── MyPagerAdapter.java
│ │ │ ├── PhotoAdapter.java
│ │ │ ├── TextAdapter.java
│ │ │ └── VideoAdapter.java
│ │ │ ├── dailysaying
│ │ │ └── DailySayingActivity.java
│ │ │ ├── entity
│ │ │ ├── PhotoEntity.java
│ │ │ ├── TabEntity.java
│ │ │ ├── TextEntity.java
│ │ │ └── VideoEntity.java
│ │ │ ├── fragment
│ │ │ ├── HomeFragment.java
│ │ │ ├── MyFragment.java
│ │ │ ├── PhotoFragment.java
│ │ │ ├── ReleaseFragment.java
│ │ │ ├── TextFragment.java
│ │ │ └── VideoFragment.java
│ │ │ ├── listener
│ │ │ ├── OnItemChildClickListener.java
│ │ │ └── OnItemClickListener.java
│ │ │ ├── login
│ │ │ ├── LoginActivity.java
│ │ │ ├── StartActivity.java
│ │ │ └── UpdatePwordActivity.java
│ │ │ ├── register
│ │ │ └── RegisterActivity.java
│ │ │ ├── releasephoto
│ │ │ └── ReleasePhotoActivity.java
│ │ │ ├── releaseprogress
│ │ │ ├── PhotoProgressActivity.java
│ │ │ ├── ProgressActivity.java
│ │ │ ├── TextProgressActivity.java
│ │ │ └── VideoProgressActivity.java
│ │ │ ├── releasetext
│ │ │ └── ReleaseTextActivity.java
│ │ │ ├── releasevideo
│ │ │ └── ReleaseVideoActivity.java
│ │ │ ├── utils
│ │ │ ├── AppConfig.java
│ │ │ ├── BaseActivity.java
│ │ │ ├── StringUtils.java
│ │ │ ├── Tag.java
│ │ │ └── Utils.java
│ │ │ ├── view
│ │ │ ├── CircleTransform.java
│ │ │ └── FixedViewPager.java
│ │ │ └── welcome
│ │ │ ├── BaseActivity.java
│ │ │ ├── InitAdvActivity.java
│ │ │ └── StartPageActivity.java
│ └── res
│ │ ├── drawable-v24
│ │ ├── btn_01.png
│ │ ├── ic_launcher_foreground.xml
│ │ ├── login_bag.png
│ │ ├── login_btn.xml
│ │ ├── pic1.jpg
│ │ ├── pic2.jpg
│ │ ├── pic3.jpg
│ │ ├── pic4.jpg
│ │ ├── pic5.jpg
│ │ ├── selector.xml
│ │ ├── selector_tabtext.xml
│ │ ├── shape_big_login_btn.xml
│ │ ├── shape_big_register_btn.xml
│ │ ├── shape_login_btn.xml
│ │ ├── shape_login_form.xml
│ │ ├── shape_register_btn.xml
│ │ ├── shape_search_box.xml
│ │ └── skipshape.xml
│ │ ├── drawable
│ │ ├── ic_arrow_back_black_24dp.xml
│ │ ├── ic_assignment_black_24dp.xml
│ │ ├── ic_info_black_24dp.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_person_black_24dp.xml
│ │ ├── ic_web_black_24dp.xml
│ │ └── shape_my_info_bg.xml
│ │ ├── layout
│ │ ├── activity_about.xml
│ │ ├── activity_adv.xml
│ │ ├── activity_daily_saying.xml
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ ├── activity_photo_progress.xml
│ │ ├── activity_progress.xml
│ │ ├── activity_register.xml
│ │ ├── activity_release_photo.xml
│ │ ├── activity_release_text.xml
│ │ ├── activity_release_video.xml
│ │ ├── activity_start.xml
│ │ ├── activity_text_progress.xml
│ │ ├── activity_update_pword.xml
│ │ ├── activity_video_progress.xml
│ │ ├── fragment_home.xml
│ │ ├── fragment_my.xml
│ │ ├── fragment_photo.xml
│ │ ├── fragment_release.xml
│ │ ├── fragment_text.xml
│ │ ├── fragment_video.xml
│ │ ├── item_photo_layout.xml
│ │ ├── item_text_layout.xml
│ │ ├── item_video_layout.xml
│ │ ├── layout_hello.xml
│ │ ├── layout_hello2.xml
│ │ ├── layout_hello3.xml
│ │ ├── layout_hello4.xml
│ │ └── layout_hello5.xml
│ │ ├── menu
│ │ └── menu.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── login.png
│ │ ├── pwd.png
│ │ └── start_welcome.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── about.png
│ │ ├── app_icon.png
│ │ ├── collect.png
│ │ ├── collect_select.png
│ │ ├── comment.png
│ │ ├── dailyjubj.png
│ │ ├── dianzan.png
│ │ ├── dianzan_select.png
│ │ ├── header.png
│ │ ├── home_selected.png
│ │ ├── home_unselect.png
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── icon_collect.png
│ │ ├── icon_left_arrow.png
│ │ ├── icon_skin.png
│ │ ├── logout.png
│ │ ├── my_selected.png
│ │ ├── my_unselect.png
│ │ ├── releasebag.png
│ │ ├── releasepg.png
│ │ ├── search.png
│ │ ├── send_selected.png
│ │ ├── send_unselect.png
│ │ └── updatepword.png
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ ├── network_security_config.xml
│ │ └── provider_paths.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── coalreport
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CoalReport
2 | 开发工具为Android Studio,开发语言为Java,结合mysql数据库,UI界面使用fragment。app后端服务器采用SpringBoot+Mybatis框架,提供了若干接口给app与MySQL交互,该项目实现了一个可以发布文字、图片及视频的app,同时还实现了用SpringBoot+Mybatis框架,前端采用Thymeleaf+Bootstrap来实现页面效果展示,用于app的后台管理系统。
3 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.3"
6 | defaultConfig {
7 | applicationId "com.example.coalreport"
8 | minSdkVersion 21
9 | targetSdkVersion 29
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | compileOptions {
22 | sourceCompatibility 1.8
23 | targetCompatibility 1.8
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(include: ['*.jar'], dir: 'libs')
30 | implementation 'androidx.appcompat:appcompat:1.0.2'
31 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
32 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
33 | testImplementation 'junit:junit:4.12'
34 | androidTestImplementation 'androidx.test.ext:junit:1.1.0'
35 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
36 | implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
37 | implementation 'androidx.recyclerview:recyclerview:1.0.0'
38 | implementation 'com.github.dueeeke.dkplayer:dkplayer-java:3.2.6'
39 | implementation 'com.github.dueeeke.dkplayer:dkplayer-ui:3.2.6'
40 | implementation 'com.github.dueeeke.dkplayer:player-exo:3.2.6'
41 | implementation 'com.github.dueeeke.dkplayer:player-ijk:3.2.6'
42 | implementation 'com.github.dueeeke.dkplayer:videocache:3.2.6'
43 | implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.3'
44 | implementation 'skin.support:skin-support:4.0.5'
45 | // skin-support
46 | implementation 'skin.support:skin-support-appcompat:4.0.5'
47 | // skin-support 基础控件支持
48 | implementation 'com.squareup.okhttp3:okhttp:3.10.0'
49 | implementation 'com.github.bumptech.glide:glide:3.5.2'
50 | implementation 'com.github.HanHuoBin:BaseDialog:1.2.0'
51 | implementation 'com.squareup.picasso:picasso:2.5.2'
52 | implementation 'org.xutils:xutils:3.8.3'
53 | implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.3'
54 | }
55 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/coalreport/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.example.coalreport", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
55 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.viewpager.widget.ViewPager;
6 |
7 | import android.content.Intent;
8 | import android.view.Menu;
9 | import android.view.MenuInflater;
10 | import android.view.MenuItem;
11 | import android.widget.Toast;
12 |
13 | import com.example.coalreport.about.AboutActivity;
14 | import com.example.coalreport.adapter.MyPagerAdapter;
15 | import com.example.coalreport.dailysaying.DailySayingActivity;
16 | import com.example.coalreport.entity.TabEntity;
17 | import com.example.coalreport.fragment.HomeFragment;
18 | import com.example.coalreport.fragment.MyFragment;
19 | import com.example.coalreport.fragment.ReleaseFragment;
20 | import com.example.coalreport.login.LoginActivity;
21 | import com.example.coalreport.utils.BaseActivity;
22 | import com.flyco.tablayout.CommonTabLayout;
23 | import com.flyco.tablayout.listener.CustomTabEntity;
24 | import com.flyco.tablayout.listener.OnTabSelectListener;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class MainActivity extends BaseActivity {
30 |
31 | private String[] mTitles = {"首页", "发布", "我的"};
32 |
33 | //未选中图标
34 | private int[] mIconUnselectIds = {
35 | R.mipmap.home_unselect,
36 | R.mipmap.send_unselect,
37 | R.mipmap.my_unselect
38 |
39 | };
40 |
41 |
42 | //选中图标
43 | private int[] mIconSelectIds = {
44 | R.mipmap.home_selected,
45 | R.mipmap.send_selected,
46 | R.mipmap.my_selected
47 | };
48 |
49 | private ArrayList mFragments = new ArrayList<>();
50 | //Tab选项(标题、选中图标、未选中图标)
51 | private ArrayList mTabEntities = new ArrayList<>();
52 | private ViewPager viewPager;
53 | private CommonTabLayout commonTabLayout;
54 |
55 | @Override
56 | protected int initLayout() {
57 | return R.layout.activity_main;
58 | }
59 |
60 | //初始化
61 | @Override
62 | protected void initView() {
63 | viewPager = findViewById(R.id.viewpager);
64 | commonTabLayout = findViewById(R.id.commonTabLayout);
65 | }
66 |
67 | /**
68 | * @param menu
69 | * @return
70 | */
71 |
72 | @Override
73 | public boolean onCreateOptionsMenu(Menu menu) {
74 | MenuInflater menuInflater = new MenuInflater(this);
75 | menuInflater.inflate(R.menu.menu, menu);
76 | return super.onCreateOptionsMenu(menu);
77 | }
78 |
79 |
80 | //给菜单设置点击事件
81 | @Override
82 | public boolean onOptionsItemSelected(@NonNull MenuItem item) {
83 | switch (item.getItemId()) {
84 | case R.id.dailysaying:
85 | Intent intent = new Intent(MainActivity.this, DailySayingActivity.class);
86 | startActivity(intent);
87 | break;
88 | case R.id.about:
89 | Intent intent1 = new Intent(MainActivity.this, AboutActivity.class);
90 | startActivity(intent1);
91 | break;
92 | case R.id.logout:
93 | Toast.makeText(MainActivity.this, "退出成功", Toast.LENGTH_SHORT).show();
94 | this.onBackPressed();
95 | Intent it = new Intent(MainActivity.this, LoginActivity.class);
96 | startActivity(it);
97 | }
98 | return super.onOptionsItemSelected(item);
99 | }
100 |
101 | @Override
102 | protected void initData() {
103 | //实例化fragment
104 | mFragments.add(HomeFragment.newInstance());
105 | mFragments.add(ReleaseFragment.newInstance());
106 | mFragments.add(MyFragment.newInstance());
107 | //初始化Tab选项
108 | for (int i = 0; i < mTitles.length; i++) {
109 | mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i]));
110 | }
111 | commonTabLayout.setTabData(mTabEntities);
112 | commonTabLayout.setOnTabSelectListener(new OnTabSelectListener() {
113 | @Override
114 | public void onTabSelect(int position) {
115 | viewPager.setCurrentItem(position);
116 | }
117 |
118 | @Override
119 | public void onTabReselect(int position) {
120 | }
121 | });
122 | viewPager.setOffscreenPageLimit(mFragments.size());
123 | viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
124 | @Override
125 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
126 | }
127 |
128 | @Override
129 | public void onPageSelected(int position) {
130 | commonTabLayout.setCurrentTab(position);
131 | }
132 |
133 | @Override
134 | public void onPageScrollStateChanged(int state) {
135 | }
136 | });
137 | viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), mTitles, mFragments));
138 | }
139 |
140 | //回调
141 | @Override
142 | public void onActivityResult(int requestCode, int resultCode, Intent data) {
143 | super.onActivityResult(requestCode, resultCode, data);
144 | if (getSupportFragmentManager().getFragments() != null && getSupportFragmentManager().getFragments().size() > 0) {
145 | List fragments = getSupportFragmentManager().getFragments();
146 | for (Fragment mFragment : fragments) {
147 | mFragment.onActivityResult(requestCode, resultCode, data);
148 | }
149 | }
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/MyApp.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport;
2 |
3 | import android.app.Application;
4 | import android.content.SharedPreferences;
5 |
6 | import skin.support.SkinCompatManager;
7 | import skin.support.app.SkinAppCompatViewInflater;
8 |
9 | import org.xutils.x;
10 |
11 | /**
12 | * @author a-cper-cpu
13 | */
14 |
15 | public class MyApp extends Application {
16 |
17 | @Override
18 | public void onCreate() {
19 | super.onCreate();
20 | x.Ext.init(this);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/about/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.about;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 |
7 | import com.example.coalreport.R;
8 |
9 | /**
10 | * @author a-cper-cpu
11 | * 关于界面,就显示信息
12 | */
13 |
14 |
15 | public class AboutActivity extends AppCompatActivity {
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | super.onCreate(savedInstanceState);
20 | setContentView(R.layout.activity_about);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/adapter/HomeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.adapter;
2 |
3 | import androidx.fragment.app.Fragment;
4 | import androidx.fragment.app.FragmentManager;
5 | import androidx.fragment.app.FragmentPagerAdapter;
6 |
7 | import java.util.ArrayList;
8 |
9 |
10 | /**
11 | * @author a-cper-cpu
12 | * 适配器
13 | */
14 |
15 | public class HomeAdapter extends FragmentPagerAdapter {
16 |
17 | private String[] mTitles;
18 | private ArrayList mFragments;
19 |
20 | public HomeAdapter(FragmentManager fm, String[] titles, ArrayList fragments) {
21 | super(fm);
22 | this.mTitles = titles;
23 | this.mFragments = fragments;
24 | }
25 |
26 | @Override
27 | public int getCount() {
28 | return mFragments.size();
29 | }
30 |
31 | @Override
32 | public CharSequence getPageTitle(int position) {
33 | return mTitles[position];
34 | }
35 |
36 | @Override
37 | public Fragment getItem(int position) {
38 | return mFragments.get(position);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/adapter/MyPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.adapter;
2 |
3 | import androidx.fragment.app.Fragment;
4 | import androidx.fragment.app.FragmentManager;
5 | import androidx.fragment.app.FragmentPagerAdapter;
6 |
7 | import java.util.ArrayList;
8 |
9 |
10 | /**
11 | * @author a-cper-cpu
12 | * 适配器
13 | */
14 |
15 | public class MyPagerAdapter extends FragmentPagerAdapter {
16 |
17 | private String[] mTitles;
18 | private ArrayList mFragments;
19 |
20 | public MyPagerAdapter(FragmentManager fm, String[] titles, ArrayList fragments) {
21 | super(fm);
22 | this.mTitles = titles;
23 | this.mFragments = fragments;
24 | }
25 |
26 | @Override
27 | public int getCount() {
28 | return mFragments.size();
29 | }
30 |
31 | @Override
32 | public CharSequence getPageTitle(int position) {
33 | return mTitles[position];
34 | }
35 |
36 | @Override
37 | public Fragment getItem(int position) {
38 | return mFragments.get(position);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/adapter/PhotoAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.adapter;
2 |
3 | import android.app.ProgressDialog;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.os.SystemClock;
7 | import android.util.Log;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.FrameLayout;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.recyclerview.widget.RecyclerView;
17 |
18 | import com.dueeeke.videocontroller.component.PrepareView;
19 |
20 | import com.example.coalreport.entity.PhotoEntity;
21 | import com.squareup.picasso.Picasso;
22 |
23 |
24 | import com.example.coalreport.R;
25 | import com.example.coalreport.entity.VideoEntity;
26 |
27 | import com.example.coalreport.listener.OnItemChildClickListener;
28 | import com.example.coalreport.listener.OnItemClickListener;
29 | import com.example.coalreport.view.CircleTransform;
30 |
31 |
32 | import org.xutils.x;
33 |
34 | import java.util.List;
35 |
36 |
37 | /**
38 | * @author a-cper-cpu
39 | * 图片 适配器
40 | */
41 |
42 | public class PhotoAdapter extends RecyclerView.Adapter {
43 |
44 |
45 | private Context mContext;
46 |
47 | //数据
48 | private List mDatas;
49 |
50 | private OnItemChildClickListener mOnItemChildClickListener;
51 |
52 | private OnItemClickListener mOnItemClickListener;
53 |
54 | public PhotoAdapter(Context context, List datas) {
55 | this.mContext = context;
56 | this.mDatas = datas;
57 | }
58 |
59 |
60 | /**
61 | * @author 黄卓
62 | * 布局效果
63 | */
64 | @NonNull
65 | @Override
66 | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
67 | View view = LayoutInflater.from(mContext).inflate(R.layout.item_photo_layout, parent, false);
68 | //容纳View视图
69 | ViewHolder viewHolder = new ViewHolder(view);
70 | return viewHolder;
71 | }
72 |
73 |
74 | /**
75 | * @author 黄卓
76 | * 绑定数据
77 | */
78 |
79 | @Override
80 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
81 | ViewHolder vh = (ViewHolder) holder;
82 | //把获取到的PhotoEntity实体集,点击哪个就填充哪个实体
83 | PhotoEntity photoEntity = mDatas.get(position);
84 | vh.tvTitle.setText(photoEntity.getVtitle());
85 | vh.tvAuthor.setText(photoEntity.getAuthor());
86 | vh.tvCollect.setText(String.valueOf(photoEntity.getvCollect()));
87 | vh.tvComment.setText(String.valueOf(photoEntity.getCommentCount()));
88 | vh.tvDz.setText(String.valueOf(photoEntity.getDzCount()));
89 | vh.textreport.setText(photoEntity.getText_report());
90 | //Picasso框架 加载图片,更新UI
91 | Picasso.with(mContext)
92 | .load(photoEntity.getHeadurl())
93 | //设置原型头像
94 | .transform(new CircleTransform())
95 | .into(vh.tvHeader);
96 | Picasso.with(mContext)
97 | .load(photoEntity.getReporturl())
98 | .into(vh.imgreport);
99 | }
100 |
101 | @Override
102 | public int getItemCount() {
103 | return mDatas.size();
104 | }
105 |
106 |
107 | public class ViewHolder extends RecyclerView.ViewHolder {
108 | private TextView tvTitle;
109 | private TextView tvAuthor;
110 | private TextView tvDz;
111 | private TextView tvComment;
112 | private TextView tvCollect;
113 | private ImageView tvHeader;
114 | public ImageView imgreport;
115 | public TextView textreport;
116 | private ImageView img_comment;
117 | private ImageView img_dz;
118 | private ImageView img_collect;
119 | private boolean flag_collect = true;
120 | private boolean flag_dianzan = true;
121 |
122 | public ViewHolder(@NonNull View view) {
123 | super(view);
124 | tvTitle = view.findViewById(R.id.title);
125 | tvAuthor = view.findViewById(R.id.author);
126 | tvDz = view.findViewById(R.id.dz);
127 | tvComment = view.findViewById(R.id.comment);
128 | tvCollect = view.findViewById(R.id.collect);
129 | tvHeader = view.findViewById(R.id.img_header);
130 | imgreport = view.findViewById(R.id.iv_report);
131 | textreport = view.findViewById(R.id.text_report);
132 | img_dz = view.findViewById(R.id.img_like);
133 | img_collect = view.findViewById(R.id.img_collect);
134 | img_comment = view.findViewById(R.id.img_comment);
135 | img_comment.setOnClickListener(new View.OnClickListener() {
136 | @Override
137 | public void onClick(View v) {
138 | final ProgressDialog pd = ProgressDialog.show(v.getContext(), "评论功能正在完善中", "感谢您的使用!");
139 | new Thread() {
140 | public void run() {
141 | SystemClock.sleep(2000);
142 | pd.dismiss();
143 | }
144 |
145 | ;
146 | }.start();
147 | }
148 | });
149 | img_dz.setOnClickListener(new View.OnClickListener() {
150 | @Override
151 | public void onClick(View v) {
152 | if (flag_dianzan) {
153 | int dianzanNum = Integer.valueOf(tvDz.getText().toString());
154 | img_dz.setImageResource(R.mipmap.dianzan_select);
155 | tvDz.setText(String.valueOf(++dianzanNum));
156 | flag_dianzan = false;
157 | } else {
158 | int dianzanNum = Integer.valueOf(tvDz.getText().toString());
159 | img_dz.setImageResource(R.mipmap.dianzan);
160 | tvDz.setText(String.valueOf(--dianzanNum));
161 | flag_dianzan = true;
162 | }
163 | }
164 | });
165 | img_collect.setOnClickListener(new View.OnClickListener() {
166 | @Override
167 | public void onClick(View v) {
168 | if (flag_collect) {
169 | int collectNum = Integer.valueOf(tvCollect.getText().toString());
170 | img_collect.setImageResource(R.mipmap.collect_select);
171 | tvCollect.setText(String.valueOf(++collectNum));
172 | flag_collect = false;
173 | } else {
174 | int collectNum = Integer.valueOf(tvCollect.getText().toString());
175 | img_collect.setImageResource(R.mipmap.collect);
176 | tvCollect.setText(String.valueOf(--collectNum));
177 | flag_collect = true;
178 | }
179 | }
180 | });
181 | }
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/adapter/TextAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.adapter;
2 |
3 | import android.app.ProgressDialog;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.os.SystemClock;
7 | import android.util.Log;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.FrameLayout;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.recyclerview.widget.RecyclerView;
17 |
18 | import com.dueeeke.videocontroller.component.PrepareView;
19 |
20 | import com.example.coalreport.entity.PhotoEntity;
21 | import com.example.coalreport.entity.TextEntity;
22 | import com.squareup.picasso.Picasso;
23 |
24 |
25 | import com.example.coalreport.R;
26 | import com.example.coalreport.entity.VideoEntity;
27 |
28 | import com.example.coalreport.listener.OnItemChildClickListener;
29 | import com.example.coalreport.listener.OnItemClickListener;
30 | import com.example.coalreport.view.CircleTransform;
31 |
32 |
33 | import org.xutils.x;
34 |
35 | import java.util.List;
36 |
37 | /**
38 | * @author a-cper-cpu
39 | * 文字适配器
40 | */
41 |
42 | public class TextAdapter extends RecyclerView.Adapter {
43 |
44 |
45 | private Context mContext;
46 | private List mDatas;
47 | private OnItemChildClickListener mOnItemChildClickListener;
48 | private OnItemClickListener mOnItemClickListener;
49 |
50 | public TextAdapter(Context context, List datas) {
51 | this.mContext = context;
52 | this.mDatas = datas;
53 | }
54 |
55 |
56 | /**
57 | * 布局效果
58 | */
59 | @NonNull
60 | @Override
61 | public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
62 | View view = LayoutInflater.from(mContext).inflate(R.layout.item_text_layout, parent, false);
63 | ViewHolder viewHolder = new ViewHolder(view);
64 | return viewHolder;
65 | }
66 |
67 |
68 | /**
69 | * 绑定数据
70 | */
71 |
72 | @Override
73 | public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
74 | ViewHolder vh = (ViewHolder) holder;
75 | TextEntity textEntity = mDatas.get(position);
76 | vh.tvTitle.setText(textEntity.getVtitle());
77 | vh.tvAuthor.setText(textEntity.getAuthor());
78 | vh.tvCollect.setText(String.valueOf(textEntity.getvCollect()));
79 | vh.tvComment.setText(String.valueOf(textEntity.getCommentCount()));
80 | vh.tvDz.setText(String.valueOf(textEntity.getDzCount()));
81 | //Pocasso框架 加载图片并更新UI
82 | Picasso.with(mContext)
83 | .load(textEntity.getHeadurl())
84 | .transform(new CircleTransform())
85 | .into(vh.tvHeader);
86 | vh.textreport.setText(textEntity.getTextreport());
87 | }
88 |
89 | @Override
90 | public int getItemCount() {
91 | return mDatas.size();
92 | }
93 |
94 |
95 | public class ViewHolder extends RecyclerView.ViewHolder {
96 | private TextView tvTitle;
97 | private TextView tvAuthor;
98 | private TextView tvDz;
99 | private TextView tvComment;
100 | private TextView tvCollect;
101 | private ImageView tvHeader;
102 | public TextView textreport;
103 | private ImageView img_comment;
104 | private ImageView img_dz;
105 | private ImageView img_collect;
106 | private boolean flag_collect = true;
107 | private boolean flag_dianzan = true;
108 |
109 | public ViewHolder(@NonNull View view) {
110 | super(view);
111 | tvTitle = view.findViewById(R.id.title);
112 | tvAuthor = view.findViewById(R.id.author);
113 | tvDz = view.findViewById(R.id.dz);
114 | tvComment = view.findViewById(R.id.comment);
115 | tvCollect = view.findViewById(R.id.collect);
116 | tvHeader = view.findViewById(R.id.img_header);
117 | textreport = view.findViewById(R.id.tv_msg);
118 | img_dz = view.findViewById(R.id.img_like);
119 | img_collect = view.findViewById(R.id.img_collect);
120 | img_comment = view.findViewById(R.id.img_comment);
121 | img_comment.setOnClickListener(new View.OnClickListener() {
122 | @Override
123 | public void onClick(View v) {
124 | final ProgressDialog pd = ProgressDialog.show(v.getContext(), "评论功能正在完善中", "感谢您的使用!");
125 | new Thread() {
126 | public void run() {
127 | SystemClock.sleep(2000);
128 | pd.dismiss();
129 | }
130 |
131 | ;
132 | }.start();
133 | }
134 | });
135 |
136 | img_dz.setOnClickListener(new View.OnClickListener() {
137 | @Override
138 | public void onClick(View v) {
139 | if (flag_dianzan) {
140 | int dianzanNum = Integer.valueOf(tvDz.getText().toString());
141 | img_dz.setImageResource(R.mipmap.dianzan_select);
142 | tvDz.setText(String.valueOf(++dianzanNum));
143 | flag_dianzan = false;
144 | } else {
145 | int dianzanNum = Integer.valueOf(tvDz.getText().toString());
146 | img_dz.setImageResource(R.mipmap.dianzan);
147 | tvDz.setText(String.valueOf(--dianzanNum));
148 | flag_dianzan = true;
149 | }
150 | }
151 | });
152 |
153 | img_collect.setOnClickListener(new View.OnClickListener() {
154 | @Override
155 | public void onClick(View v) {
156 | if (flag_collect) {
157 | int collectNum = Integer.valueOf(tvCollect.getText().toString());
158 | img_collect.setImageResource(R.mipmap.collect_select);
159 | tvCollect.setText(String.valueOf(++collectNum));
160 | flag_collect = false;
161 | } else {
162 | int collectNum = Integer.valueOf(tvCollect.getText().toString());
163 | img_collect.setImageResource(R.mipmap.collect);
164 | tvCollect.setText(String.valueOf(--collectNum));
165 | flag_collect = true;
166 | }
167 | }
168 | });
169 | }
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/dailysaying/DailySayingActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.dailysaying;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.view.KeyEvent;
7 | import android.view.View;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 |
11 | import com.example.coalreport.R;
12 |
13 | import org.json.JSONObject;
14 |
15 | import java.io.IOException;
16 | import java.io.InputStream;
17 | import java.io.InputStreamReader;
18 | import java.net.HttpURLConnection;
19 | import java.net.URL;
20 | import java.util.Calendar;
21 |
22 | /**
23 | * @author a-cper-cpu
24 | * 每日一句
25 | */
26 |
27 | public class DailySayingActivity extends AppCompatActivity {
28 |
29 | private TextView timeText, dateText, wordText;
30 | private String mMonth, mDay, mWay, mHours, mMinute;
31 | //一言API接口
32 | public static String baseUrl = "https://v1.hitokoto.cn";
33 | private static String TAG = DailySayingActivity.class.getSimpleName();
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_daily_saying);
39 | init();
40 | }
41 |
42 | public void init() {
43 | timeText = (TextView) findViewById(R.id.time_text);
44 | dateText = (TextView) findViewById(R.id.date_text);
45 | wordText = (TextView) findViewById(R.id.word_text);
46 |
47 | }
48 |
49 |
50 | /**
51 | * 界面一启动就把系统日期填充
52 | */
53 | @Override
54 | protected void onStart() {
55 | super.onStart();
56 | Calendar calendar = Calendar.getInstance();
57 | mMonth = String.valueOf(calendar.get(Calendar.MONTH) + 1);//0-11
58 | mDay = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
59 | mWay = String.valueOf(calendar.get(Calendar.DAY_OF_WEEK));
60 | mHours = String.valueOf(calendar.get(Calendar.HOUR_OF_DAY));
61 | if (calendar.get(Calendar.MINUTE) < 10) {
62 | mMinute = "0" + calendar.get(Calendar.MINUTE);
63 | } else {
64 | mMinute = String.valueOf(calendar.get(Calendar.MINUTE));
65 | }
66 | if ("1".equals(mWay)) {
67 | mWay = "天";
68 | } else if ("2".equals(mWay)) {
69 | mWay = "一";
70 | } else if ("3".equals(mWay)) {
71 | mWay = "二";
72 | } else if ("4".equals(mWay)) {
73 | mWay = "三";
74 | } else if ("5".equals(mWay)) {
75 | mWay = "四";
76 | } else if ("6".equals(mWay)) {
77 | mWay = "五";
78 | } else if ("7".equals(mWay)) {
79 | mWay = "六";
80 | }
81 | timeText.setText(mHours + ":" + mMinute);
82 | dateText.setText(mMonth + "月" + mDay + "日" + " " + "星期" + mWay);
83 | }
84 |
85 | //点击按钮调用该方法
86 | public void OnHuanju(View v) throws IOException {
87 | sendRequestWithHttpClient();
88 | }
89 |
90 |
91 | /**
92 | * 调用一言API,其中参数c等于i代表诗词,GET请求到JSON后取出诗词然后设置文本
93 | * 操作步骤:
94 | * 1.根据接口得到url
95 | * 2.创建connection对象
96 | * 3.设置请求方式
97 | * 4.连接
98 | * 5.得到响应码,得到响应流
99 | * 6.响应流转换为字符串
100 | * 7.根据字符串得到JSON对象
101 | * 8.从JSON对象中取得hitokoto键的值,即返回的诗词
102 | * 9.设置在文本框中
103 | */
104 | private void sendRequestWithHttpClient() {
105 | new Thread(new Runnable() {
106 | @Override
107 | public void run() {
108 | try {
109 | String url1 = "https://v1.hitokoto.cn?c=i";
110 | URL url = new URL(url1);
111 | //得到connection对象。
112 | HttpURLConnection connection = (HttpURLConnection) url.openConnection();
113 | //设置请求方式
114 | connection.setRequestMethod("GET");
115 | //连接
116 | connection.connect();
117 | //得到响应码
118 | int responseCode = connection.getResponseCode();
119 | if (responseCode == HttpURLConnection.HTTP_OK) {
120 | //得到响应流
121 | InputStream inputStream = connection.getInputStream();
122 | //将响应流转换成字符串
123 | String result = is2String(inputStream);//将流转换为字符串。
124 | JSONObject jsonObject = new JSONObject(result);
125 | String value = jsonObject.optString("hitokoto");
126 | wordText.setText(value);
127 | }
128 | } catch (Exception e) {
129 | e.printStackTrace();
130 | }
131 | }
132 | }).start();
133 | }
134 |
135 | //将流转换为字符串
136 | public static String is2String(InputStream in) throws IOException {
137 | StringBuffer out = new StringBuffer();
138 | InputStreamReader inread = new InputStreamReader(in, "UTF-8");
139 | char[] b = new char[4096];
140 | for (int n; (n = inread.read(b)) != -1; ) {
141 | out.append(new String(b, 0, n));
142 | }
143 | return out.toString();
144 | }
145 |
146 | @Override
147 | protected void onDestroy() {
148 | super.onDestroy();
149 | }
150 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/entity/PhotoEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.entity;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 图片实体类
7 | */
8 | public class PhotoEntity {
9 |
10 | //id
11 | private int vid;
12 | //标题
13 | private String vtitle;
14 | //作者
15 | private String author;
16 | //点赞数
17 | private int dzCount;
18 | //评论数
19 | private int commentCount;
20 | //收藏数
21 | private int vCollect;
22 | //发布时间
23 | private String createTime;
24 | //头像
25 | private String headurl;
26 | //举报文字
27 | private String text_report;
28 | //举报图片
29 | private String reporturl;
30 |
31 | public int getVid() {
32 | return vid;
33 | }
34 |
35 | public void setVid(int vid) {
36 | this.vid = vid;
37 | }
38 |
39 | public String getVtitle() {
40 | return vtitle;
41 | }
42 |
43 | public void setVtitle(String vtitle) {
44 | this.vtitle = vtitle;
45 | }
46 |
47 | public String getAuthor() {
48 | return author;
49 | }
50 |
51 | public void setAuthor(String author) {
52 | this.author = author;
53 | }
54 |
55 | public int getDzCount() {
56 | return dzCount;
57 | }
58 |
59 | public void setDzCount(int dzCount) {
60 | this.dzCount = dzCount;
61 | }
62 |
63 | public int getCommentCount() {
64 | return commentCount;
65 | }
66 |
67 | public void setCommentCount(int commentCount) {
68 | this.commentCount = commentCount;
69 | }
70 |
71 | public int getvCollect() {
72 | return vCollect;
73 | }
74 |
75 | public void setvCollect(int vCollect) {
76 | this.vCollect = vCollect;
77 | }
78 |
79 | public String getCreateTime() {
80 | return createTime;
81 | }
82 |
83 | public void setCreateTime(String createTime) {
84 | this.createTime = createTime;
85 | }
86 |
87 | public String getHeadurl() {
88 | return headurl;
89 | }
90 |
91 | public void setHeadurl(String headurl) {
92 | this.headurl = headurl;
93 | }
94 |
95 | public String getReporturl() {
96 | return reporturl;
97 | }
98 |
99 | public void setReporturl(String reporturl) {
100 | this.reporturl = reporturl;
101 | }
102 |
103 | public String getText_report() {
104 | return text_report;
105 | }
106 |
107 | public void setText_report(String text_report) {
108 | this.text_report = text_report;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/entity/TabEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.entity;
2 |
3 | import com.flyco.tablayout.listener.CustomTabEntity;
4 |
5 | /**
6 | * @author a-cper-cpu
7 | * tab实体类
8 | * 标题、选中图标、未选中图标
9 | */
10 |
11 | public class TabEntity implements CustomTabEntity {
12 | public String title;
13 | public int selectedIcon;
14 | public int unSelectedIcon;
15 |
16 | public TabEntity(String title, int selectedIcon, int unSelectedIcon) {
17 | this.title = title;
18 | this.selectedIcon = selectedIcon;
19 | this.unSelectedIcon = unSelectedIcon;
20 | }
21 |
22 | @Override
23 | public String getTabTitle() {
24 | return title;
25 | }
26 |
27 | @Override
28 | public int getTabSelectedIcon() {
29 | return selectedIcon;
30 | }
31 |
32 | @Override
33 | public int getTabUnselectedIcon() {
34 | return unSelectedIcon;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/entity/TextEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.entity;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 文本实体类
7 | */
8 |
9 | public class TextEntity {
10 |
11 | //id
12 | private int vid;
13 | //标题
14 | private String vtitle;
15 | //作者
16 | private String author;
17 | //点赞数
18 | private int dzCount;
19 | //评论数
20 | private int commentCount;
21 | //收藏数
22 | private int vCollect;
23 | //发布时间
24 | private String createTime;
25 | //头像
26 | private String headurl;
27 | //举报文字
28 | private String textreport;
29 |
30 | public int getVid() {
31 | return vid;
32 | }
33 |
34 | public void setVid(int vid) {
35 | this.vid = vid;
36 | }
37 |
38 | public String getVtitle() {
39 | return vtitle;
40 | }
41 |
42 | public void setVtitle(String vtitle) {
43 | this.vtitle = vtitle;
44 | }
45 |
46 | public String getAuthor() {
47 | return author;
48 | }
49 |
50 | public void setAuthor(String author) {
51 | this.author = author;
52 | }
53 |
54 | public int getDzCount() {
55 | return dzCount;
56 | }
57 |
58 | public void setDzCount(int dzCount) {
59 | this.dzCount = dzCount;
60 | }
61 |
62 | public int getCommentCount() {
63 | return commentCount;
64 | }
65 |
66 | public void setCommentCount(int commentCount) {
67 | this.commentCount = commentCount;
68 | }
69 |
70 | public int getvCollect() {
71 | return vCollect;
72 | }
73 |
74 | public void setvCollect(int vCollect) {
75 | this.vCollect = vCollect;
76 | }
77 |
78 | public String getCreateTime() {
79 | return createTime;
80 | }
81 |
82 | public void setCreateTime(String createTime) {
83 | this.createTime = createTime;
84 | }
85 |
86 | public String getHeadurl() {
87 | return headurl;
88 | }
89 |
90 | public void setHeadurl(String headurl) {
91 | this.headurl = headurl;
92 | }
93 |
94 | public String getTextreport() {
95 | return textreport;
96 | }
97 |
98 | public void setTextreport(String textreport) {
99 | this.textreport = textreport;
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/entity/VideoEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.entity;
2 |
3 | import android.graphics.Bitmap;
4 | import android.widget.VideoView;
5 |
6 | import com.dueeeke.videocontroller.component.PrepareView;
7 |
8 | import java.io.Serializable;
9 |
10 |
11 | /**
12 | * @author a-cper-cpu
13 | * 视频实体类
14 | */
15 |
16 | public class VideoEntity implements Serializable {
17 |
18 | //id
19 | private int vid;
20 | //标题
21 | private String vtitle;
22 | //作者
23 | private String author;
24 | //点赞数
25 | private int dzCount;
26 | //评论数
27 | private int commentCount;
28 | //收藏数
29 | private int vCollect;
30 | //发布时间
31 | private String createTime;
32 | //头像
33 | private String headurl;
34 | //举报文字
35 | private String text_report;
36 | //视频
37 | private String videourl;
38 |
39 | public int getVid() {
40 | return vid;
41 | }
42 |
43 | public void setVid(int vid) {
44 | this.vid = vid;
45 | }
46 |
47 | public String getVtitle() {
48 | return vtitle;
49 | }
50 |
51 | public void setVtitle(String vtitle) {
52 | this.vtitle = vtitle;
53 | }
54 |
55 | public String getAuthor() {
56 | return author;
57 | }
58 |
59 | public void setAuthor(String author) {
60 | this.author = author;
61 | }
62 |
63 | public int getDzCount() {
64 | return dzCount;
65 | }
66 |
67 | public void setDzCount(int dzCount) {
68 | this.dzCount = dzCount;
69 | }
70 |
71 | public int getCommentCount() {
72 | return commentCount;
73 | }
74 |
75 | public void setCommentCount(int commentCount) {
76 | this.commentCount = commentCount;
77 | }
78 |
79 | public String getCreateTime() {
80 | return createTime;
81 | }
82 |
83 | public void setCreateTime(String createTime) {
84 | this.createTime = createTime;
85 | }
86 |
87 | public int getvCollect() {
88 | return vCollect;
89 | }
90 |
91 | public void setvCollect(int vCollect) {
92 | this.vCollect = vCollect;
93 | }
94 |
95 | // public String getVideoUrl() {
96 | // return videoUrl;
97 | // }
98 | //
99 | // public void setVideoUrl(String videoUrl) {
100 | // this.videoUrl = videoUrl;
101 | // }
102 |
103 |
104 | public String getHeadurl() {
105 | return headurl;
106 | }
107 |
108 | public void setHeadurl(String headurl) {
109 | this.headurl = headurl;
110 | }
111 |
112 | public String getVideourl() {
113 | return videourl;
114 | }
115 |
116 | public void setVideourl(String videourl) {
117 | this.videourl = videourl;
118 | }
119 |
120 | public String getText_report() {
121 | return text_report;
122 | }
123 |
124 | public void setText_report(String text_report) {
125 | this.text_report = text_report;
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/fragment/HomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.annotation.Nullable;
8 | import androidx.fragment.app.Fragment;
9 | import androidx.viewpager.widget.ViewPager;
10 |
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 |
15 | import com.example.coalreport.R;
16 | import com.example.coalreport.adapter.HomeAdapter;
17 | import com.flyco.tablayout.SlidingTabLayout;
18 |
19 | import java.util.ArrayList;
20 |
21 | /**
22 | * @author a-cper-cpu
23 | * 首页fragment
24 | */
25 |
26 | public class HomeFragment extends Fragment {
27 |
28 | private ArrayList mFragments = new ArrayList<>();
29 | //选项标题
30 | private String[] mTitles = {
31 | "视频", "文字", "图片"
32 | };
33 | private ViewPager viewPager;
34 | //选项Tab
35 | private SlidingTabLayout slidingTabLayout;
36 |
37 | public HomeFragment() {
38 | // Required empty public constructor
39 | }
40 |
41 | public static HomeFragment newInstance() {
42 | HomeFragment fragment = new HomeFragment();
43 | return fragment;
44 | }
45 |
46 | @Override
47 | public void onCreate(Bundle savedInstanceState) {
48 | super.onCreate(savedInstanceState);
49 | }
50 |
51 | //初始化
52 | @Override
53 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
54 | Bundle savedInstanceState) {
55 | View v = inflater.inflate(R.layout.fragment_home, container, false);
56 | viewPager = v.findViewById(R.id.fixedViewPager);
57 | slidingTabLayout = v.findViewById(R.id.slidingTabLayout);
58 | return v;
59 | }
60 |
61 |
62 | //填充数据
63 | @Override
64 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
65 | super.onViewCreated(view, savedInstanceState);
66 | mFragments.add(VideoFragment.newInstance(mTitles[0]));
67 | mFragments.add(TextFragment.newInstance(mTitles[1]));
68 | mFragments.add(PhotoFragment.newInstance(mTitles[2]));
69 | viewPager.setOffscreenPageLimit(mFragments.size());
70 | viewPager.setAdapter(new HomeAdapter(getFragmentManager(), mTitles, mFragments));
71 | slidingTabLayout.setViewPager(viewPager);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/fragment/PhotoFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.fragment;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.fragment.app.Fragment;
12 | import androidx.recyclerview.widget.LinearLayoutManager;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.example.coalreport.R;
16 | import com.example.coalreport.adapter.PhotoAdapter;
17 | import com.example.coalreport.entity.PhotoEntity;
18 | import com.example.coalreport.utils.AppConfig;
19 | import com.scwang.smartrefresh.layout.api.RefreshLayout;
20 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
21 |
22 | import org.json.JSONArray;
23 | import org.json.JSONObject;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | import okhttp3.OkHttpClient;
29 | import okhttp3.Request;
30 | import okhttp3.Response;
31 |
32 |
33 | /**
34 | * @author a-cper-cpu
35 | * 首页里图片fragment
36 | */
37 |
38 | public class PhotoFragment extends Fragment {
39 |
40 | private boolean isCreated = false;
41 | private String title;
42 | private RecyclerView recyclerView;
43 | private RefreshLayout refreshLayout;
44 | private List datas = new ArrayList<>();
45 | private LinearLayoutManager linearLayoutManager;
46 |
47 | public PhotoFragment() {
48 | // Required empty public constructor
49 | }
50 |
51 |
52 | //实例化fragment
53 | public static PhotoFragment newInstance(String title) {
54 | PhotoFragment fragment = new PhotoFragment();
55 | fragment.title = title;
56 | return fragment;
57 | }
58 |
59 | @Override
60 | public void onCreate(Bundle savedInstanceState) {
61 | super.onCreate(savedInstanceState);
62 | }
63 |
64 | //初始化
65 | @Override
66 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
67 | Bundle savedInstanceState) {
68 | View v = inflater.inflate(R.layout.fragment_photo, container, false);
69 | //类似listview,来一项一项展示数据
70 | recyclerView = v.findViewById(R.id.recyclerView1);
71 | //布局
72 | refreshLayout = v.findViewById(R.id.refreshLayoutphoto);
73 | return v;
74 | }
75 |
76 |
77 | @Override
78 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
79 | super.onViewCreated(view, savedInstanceState);
80 | linearLayoutManager = new LinearLayoutManager(getActivity());
81 | linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
82 | recyclerView.setLayoutManager(linearLayoutManager);
83 | //当下拉刷新时,刷新数据并更新UI
84 | refreshLayout.setOnRefreshListener(new OnRefreshListener() {
85 | @Override
86 | public void onRefresh(@NonNull RefreshLayout refreshLayout) {
87 | getVideoList(true);
88 | }
89 | });
90 | isCreated = true;
91 | getVideoList(isCreated);
92 | }
93 |
94 | /**
95 | * @param isRefresh 核心功能
96 | * 用来从后台服务器获取数据,并更新UI
97 | */
98 | private void getVideoList(final boolean isRefresh) {
99 | if (isRefresh) {
100 | refreshLayout.finishRefresh(true);
101 | }
102 | new Thread(new Runnable() {
103 | @Override
104 | public void run() {
105 | try {
106 | OkHttpClient okHttpClient = new OkHttpClient();
107 | //创造http请求
108 | Request request = new Request.Builder().get()
109 | .url(AppConfig.BASE_URl + "/getReleasePhoto")
110 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
111 | .build();
112 | //执行发送的指令
113 | Response response = okHttpClient.newCall(request).execute();
114 | final String responseData = response.body().string();
115 | JSONArray jsonArray = new JSONArray(responseData);
116 | datas = new ArrayList<>();
117 | // 获取UI中各组件的数据,并填充更新UI
118 | for (int i = 0; i < jsonArray.length(); i++) {
119 | JSONObject jsonObject = jsonArray.getJSONObject(i);
120 | final String json_account = jsonObject.getString("id");
121 | final String json_releaseText = jsonObject.getString("releaseText");
122 | final String json_rpeleasePhoto = jsonObject.getString("releasePhoto");
123 | final String json_releaseTime = jsonObject.getString("releaseTime");
124 | OkHttpClient okHttpClient1 = new OkHttpClient();
125 | //创造http请求
126 | Request request1 = new Request.Builder().get()
127 | .url(AppConfig.BASE_URl + "/getUserName?id=" + json_account)
128 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
129 | .build();
130 | //执行发送的指令
131 | Response response1 = okHttpClient1.newCall(request1).execute();
132 | final String responseData1 = response1.body().string();
133 | JSONObject jsonObject1 = new JSONObject(responseData1);
134 | final String json_releaseUsername = jsonObject1.getString("userName");
135 | final String json_releaseSaying = jsonObject1.getString("saying");
136 | final String json_releasePhoto = jsonObject1.getString("photo");
137 | PhotoEntity ve = new PhotoEntity();
138 | ve.setVtitle(json_releaseSaying);
139 | ve.setAuthor(json_releaseUsername);
140 | ve.setDzCount(1);
141 | ve.setCommentCount(1);
142 | ve.setvCollect(1);
143 | ve.setHeadurl(json_releasePhoto);
144 | ve.setReporturl(json_rpeleasePhoto);
145 | ve.setText_report(json_releaseText);
146 | datas.add(ve);
147 | }
148 | } catch (Exception e) {
149 | e.printStackTrace();
150 | }
151 | }
152 | }).start();
153 | PhotoAdapter photoAdapter = new PhotoAdapter(getActivity(), datas);
154 | recyclerView.setAdapter(photoAdapter);
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/fragment/ReleaseFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.fragment;
2 |
3 | import android.app.Activity;
4 | import android.app.AlertDialog;
5 | import android.content.Context;
6 | import android.content.DialogInterface;
7 | import android.content.Intent;
8 | import android.net.Uri;
9 | import android.os.Bundle;
10 |
11 | import androidx.core.content.FileProvider;
12 | import androidx.fragment.app.Fragment;
13 |
14 | import android.provider.MediaStore;
15 | import android.view.LayoutInflater;
16 | import android.view.View;
17 | import android.view.ViewGroup;
18 | import android.widget.Button;
19 |
20 | import com.example.coalreport.MainActivity;
21 | import com.example.coalreport.R;
22 | import com.example.coalreport.login.LoginActivity;
23 | import com.example.coalreport.releasephoto.ReleasePhotoActivity;
24 | import com.example.coalreport.releasetext.ReleaseTextActivity;
25 | import com.example.coalreport.releasevideo.ReleaseVideoActivity;
26 |
27 | import java.io.File;
28 | import java.util.Date;
29 |
30 | /**
31 | * @author a-cper-cpu
32 | * 发布fragment
33 | * 1.文字举报
34 | * 2.图片举报
35 | * 3.视频举报
36 | */
37 |
38 |
39 | public class ReleaseFragment extends Fragment {
40 | private Button btn_report;
41 |
42 | public ReleaseFragment() {
43 | // Required empty public constructor
44 | }
45 |
46 | // TODO: Rename and change types and number of parameters
47 | public static ReleaseFragment newInstance() {
48 | ReleaseFragment fragment = new ReleaseFragment();
49 | return fragment;
50 | }
51 |
52 | @Override
53 | public void onCreate(Bundle savedInstanceState) {
54 | super.onCreate(savedInstanceState);
55 | }
56 |
57 | @Override
58 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
59 | Bundle savedInstanceState) {
60 | View myView = inflater.inflate(R.layout.fragment_release, container, false);
61 | btn_report = myView.findViewById(R.id.btn_report);
62 | btn_report.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View v) {
65 | showImagePickDialog(getActivity());
66 | }
67 | });
68 | return myView;
69 | }
70 |
71 |
72 | /**
73 | * 显示获取照片不同方式对话框
74 | */
75 | public static void showImagePickDialog(final Activity activity) {
76 | String title = "选择举报方式";
77 | String[] items = new String[]{"文字举报", "图片举报", "视频举报"};
78 | new AlertDialog.Builder(activity)
79 | .setTitle(title)
80 | .setItems(items, new DialogInterface.OnClickListener() {
81 | @Override
82 | public void onClick(DialogInterface dialog, int which) {
83 | dialog.dismiss();
84 | switch (which) {
85 | case 0:
86 | Intent it = new Intent(activity, ReleaseTextActivity.class);
87 | //intent传参,把id传过去
88 | it.putExtra("id", activity.getIntent().getStringExtra("id"));
89 | activity.startActivity(it);
90 | break;
91 | case 1:
92 | Intent it1 = new Intent(activity, ReleasePhotoActivity.class);
93 | it1.putExtra("id", activity.getIntent().getStringExtra("id"));
94 | activity.startActivity(it1);
95 | break;
96 | case 2:
97 | Intent it2 = new Intent(activity, ReleaseVideoActivity.class);
98 | it2.putExtra("id", activity.getIntent().getStringExtra("id"));
99 | activity.startActivity(it2);
100 | break;
101 | default:
102 | break;
103 | }
104 | }
105 | })
106 | .show();
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/fragment/TextFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.fragment;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 |
7 | import androidx.annotation.NonNull;
8 | import androidx.annotation.Nullable;
9 | import androidx.fragment.app.Fragment;
10 | import androidx.recyclerview.widget.LinearLayoutManager;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import android.view.LayoutInflater;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 | import android.widget.FrameLayout;
17 |
18 | import com.example.coalreport.R;
19 | import com.example.coalreport.adapter.PhotoAdapter;
20 | import com.example.coalreport.adapter.TextAdapter;
21 | import com.example.coalreport.adapter.VideoAdapter;
22 | import com.example.coalreport.entity.PhotoEntity;
23 | import com.example.coalreport.entity.TextEntity;
24 | import com.example.coalreport.entity.VideoEntity;
25 | import com.example.coalreport.utils.AppConfig;
26 | import com.scwang.smartrefresh.layout.api.RefreshLayout;
27 | import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener;
28 | import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
29 |
30 | import org.json.JSONArray;
31 | import org.json.JSONObject;
32 |
33 | import java.util.ArrayList;
34 | import java.util.List;
35 |
36 | import okhttp3.OkHttpClient;
37 | import okhttp3.Request;
38 | import okhttp3.Response;
39 |
40 |
41 | /**
42 | * @author a-cper-cpu
43 | * 首页里文本fragment
44 | */
45 |
46 |
47 | public class TextFragment extends Fragment {
48 | private boolean isCreated = false;
49 | private String title;
50 | private RecyclerView recyclerView;
51 | private RefreshLayout refreshLayout;
52 | private List datas = new ArrayList<>();
53 | private LinearLayoutManager linearLayoutManager;
54 |
55 | public TextFragment() {
56 | // Required empty public constructor
57 | }
58 |
59 |
60 | // TODO: Rename and change types and number of parameters
61 | public static TextFragment newInstance(String title) {
62 | TextFragment fragment = new TextFragment();
63 | fragment.title = title;
64 | return fragment;
65 | }
66 |
67 | @Override
68 | public void onCreate(Bundle savedInstanceState) {
69 | super.onCreate(savedInstanceState);
70 |
71 | }
72 |
73 | @Override
74 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
75 | Bundle savedInstanceState) {
76 | // Inflate the layout for this fragment
77 | View v = inflater.inflate(R.layout.fragment_text, container, false);
78 | recyclerView = v.findViewById(R.id.recyclerView2);
79 | refreshLayout = v.findViewById(R.id.refreshLayouttext);
80 | return v;
81 | }
82 |
83 | @Override
84 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
85 | super.onViewCreated(view, savedInstanceState);
86 |
87 | linearLayoutManager = new LinearLayoutManager(getActivity());
88 | linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
89 | recyclerView.setLayoutManager(linearLayoutManager);
90 | refreshLayout.setOnRefreshListener(new OnRefreshListener() {
91 | @Override
92 | public void onRefresh(@NonNull RefreshLayout refreshLayout) {
93 | getVideoList(true);
94 | }
95 | });
96 | isCreated = true;
97 | getVideoList(isCreated);
98 | }
99 |
100 | private void getVideoList(final boolean isRefresh) {
101 | if (isRefresh) {
102 | refreshLayout.finishRefresh(true);
103 | }
104 | new Thread(new Runnable() {
105 | @Override
106 | public void run() {
107 | try {
108 | OkHttpClient okHttpClient = new OkHttpClient();
109 | //创造http请求
110 | Request request = new Request.Builder().get()
111 | .url(AppConfig.BASE_URl + "/getReleaseText")
112 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
113 | .build();
114 | //执行发送的指令
115 | Response response = okHttpClient.newCall(request).execute();
116 | final String responseData = response.body().string();
117 | JSONArray jsonArray = new JSONArray(responseData);
118 | datas = new ArrayList<>();
119 | for (int i = 0; i < jsonArray.length(); i++) {
120 | JSONObject jsonObject = jsonArray.getJSONObject(i);
121 | final String json_account = jsonObject.getString("id");
122 | final String json_releaseText = jsonObject.getString("releaseText");
123 | final String json_releaseTime = jsonObject.getString("releaseTime");
124 | OkHttpClient okHttpClient1 = new OkHttpClient();
125 | //创造http请求
126 | Request request1 = new Request.Builder().get()
127 | .url(AppConfig.BASE_URl + "/getUserName?id=" + json_account)
128 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
129 | .build();
130 | //执行发送的指令
131 | Response response1 = okHttpClient1.newCall(request1).execute();
132 | final String responseData1 = response1.body().string();
133 | JSONObject jsonObject1 = new JSONObject(responseData1);
134 | final String json_releaseUsername = jsonObject1.getString("userName");
135 | final String json_releaseSaying = jsonObject1.getString("saying");
136 | final String json_releasePhoto = jsonObject1.getString("photo");
137 | TextEntity ve = new TextEntity();
138 | ve.setVtitle(json_releaseSaying);
139 | ve.setAuthor(json_releaseUsername);
140 | ve.setDzCount(1);
141 | ve.setCommentCount(1);
142 | ve.setvCollect(1);
143 | ve.setHeadurl(json_releasePhoto);
144 | ve.setTextreport(json_releaseText);
145 | datas.add(ve);
146 | }
147 | } catch (Exception e) {
148 | e.printStackTrace();
149 | }
150 | }
151 | }).start();
152 | TextAdapter textAdapter = new TextAdapter(getActivity(), datas);
153 | recyclerView.setAdapter(textAdapter);
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/listener/OnItemChildClickListener.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.listener;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 接口
7 | */
8 |
9 | public interface OnItemChildClickListener {
10 | void onItemChildClick(int position);
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/listener/OnItemClickListener.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.listener;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 接口
7 | */
8 |
9 | public interface OnItemClickListener {
10 | void onItemClick(int position);
11 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/login/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.login;
2 |
3 | import android.app.DownloadManager;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.util.Log;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.Toast;
11 |
12 | import androidx.appcompat.app.AppCompatActivity;
13 |
14 | import com.example.coalreport.MainActivity;
15 | import com.example.coalreport.R;
16 | import com.example.coalreport.register.RegisterActivity;
17 | import com.example.coalreport.utils.AppConfig;
18 | import com.example.coalreport.utils.StringUtils;
19 | import com.example.coalreport.welcome.InitAdvActivity;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONObject;
23 |
24 | import java.io.IOException;
25 | import java.util.HashMap;
26 | import java.util.Map;
27 |
28 | import okhttp3.Call;
29 | import okhttp3.Callback;
30 | import okhttp3.FormBody;
31 | import okhttp3.MediaType;
32 | import okhttp3.OkHttpClient;
33 | import okhttp3.Request;
34 | import okhttp3.RequestBody;
35 | import okhttp3.Response;
36 |
37 | /**
38 | * @author a-cper-cpu
39 | * 登录界面
40 | */
41 |
42 | public class LoginActivity extends AppCompatActivity {
43 |
44 |
45 | private EditText etAccount;
46 | private EditText etPwd;
47 | private Button btnLogin;
48 |
49 |
50 | @Override
51 | protected void onCreate(Bundle savedInstanceState) {
52 | super.onCreate(savedInstanceState);
53 | setContentView(R.layout.activity_login);
54 | etAccount = findViewById(R.id.et_account);
55 | etPwd = findViewById(R.id.et_pwd);
56 | btnLogin = findViewById(R.id.btn_login);
57 | btnLogin.setOnClickListener(new View.OnClickListener() {
58 | @Override
59 | public void onClick(View v) {
60 | new Thread(new Runnable() {
61 | @Override
62 | public void run() {
63 | String account = etAccount.getText().toString().trim();
64 | String pwd = etPwd.getText().toString().trim();
65 | if (StringUtils.isEmpty(account)) {
66 | Toast.makeText(LoginActivity.this, "请输入账号", Toast.LENGTH_SHORT).show();
67 | return;
68 | }
69 | if (StringUtils.isEmpty(pwd)) {
70 | Toast.makeText(LoginActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
71 | return;
72 | }
73 | try {
74 | OkHttpClient okHttpClient = new OkHttpClient();
75 | //创造http请求
76 | Request request = new Request.Builder().get()
77 | .url(AppConfig.BASE_URl + "/user?id=" + account)
78 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
79 | .build();
80 | //执行发送的指令
81 | Response response = okHttpClient.newCall(request).execute();
82 | final String responseData = response.body().string();
83 | JSONObject jsonObject = new JSONObject(responseData);
84 | final String json_account = jsonObject.getString("id");
85 | final String json_pwd = jsonObject.getString("passWord");
86 | if (account.equals(json_account)) {
87 | if (pwd.equals(json_pwd)) {
88 | runOnUiThread(new Runnable() {
89 | @Override
90 | public void run() {
91 | Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
92 | }
93 | });
94 | finish();
95 | Intent it = new Intent(LoginActivity.this, MainActivity.class);
96 | it.putExtra("id", json_account);
97 | startActivity(it);
98 | } else {
99 | runOnUiThread(new Runnable() {
100 | @Override
101 | public void run() {
102 | Toast.makeText(LoginActivity.this, "登录失败,请确保密码正确!", Toast.LENGTH_SHORT).show();
103 | }
104 | });
105 | }
106 | } else {
107 | runOnUiThread(new Runnable() {
108 | @Override
109 | public void run() {
110 | Toast.makeText(LoginActivity.this, "登录失败,请确保账号正确!", Toast.LENGTH_SHORT).show();
111 | }
112 | });
113 | }
114 | } catch (Exception e) {
115 | e.printStackTrace();
116 | runOnUiThread(new Runnable() {
117 | @Override
118 | public void run() {
119 | Toast.makeText(LoginActivity.this, "未查询到该账户,请先注册", Toast.LENGTH_SHORT).show();
120 | }
121 | });
122 | }
123 | }
124 | }).start();
125 | }
126 | });
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/login/StartActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.login;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 |
8 | import androidx.appcompat.app.AppCompatActivity;
9 |
10 | import com.example.coalreport.R;
11 | import com.example.coalreport.register.RegisterActivity;
12 |
13 | /**
14 | * @author a-cper-cpu
15 | * 选择界面
16 | */
17 |
18 |
19 | public class StartActivity extends AppCompatActivity {
20 |
21 | private Button btnLogin;
22 | private Button btnRegister;
23 |
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_start);
29 | btnLogin = findViewById(R.id.btn_login);
30 | btnLogin.setOnClickListener(new View.OnClickListener() {
31 | @Override
32 | public void onClick(View v) {
33 | Intent in = new Intent(StartActivity.this, LoginActivity.class);
34 | startActivity(in);
35 | }
36 | });
37 | btnRegister = findViewById(R.id.btn_register);
38 | btnRegister.setOnClickListener(new View.OnClickListener() {
39 | @Override
40 | public void onClick(View v) {
41 | Intent inr = new Intent(StartActivity.this, RegisterActivity.class);
42 | startActivity(inr);
43 | }
44 | });
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/login/UpdatePwordActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.login;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import android.widget.Toast;
10 |
11 | import com.example.coalreport.R;
12 | import com.example.coalreport.utils.AppConfig;
13 | import com.example.coalreport.utils.StringUtils;
14 |
15 | import okhttp3.FormBody;
16 | import okhttp3.OkHttpClient;
17 | import okhttp3.Request;
18 | import okhttp3.Response;
19 |
20 | /**
21 | * @author a-cper-cpu
22 | * 修改密码界面
23 | */
24 |
25 |
26 | public class UpdatePwordActivity extends AppCompatActivity {
27 |
28 | private EditText et_password;
29 | private Button btn_updatepw;
30 |
31 | @Override
32 | protected void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.activity_update_pword);
35 | et_password = findViewById(R.id.et_updatepwd);
36 | btn_updatepw = findViewById(R.id.btn_updatepword);
37 | btn_updatepw.setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View v) {
40 | if (StringUtils.isEmpty(et_password.getText().toString().trim())) {
41 | Toast.makeText(UpdatePwordActivity.this, "密码为空,请重新输入!", Toast.LENGTH_SHORT).show();
42 | return;
43 | }
44 | new Thread(new Runnable() {
45 | @Override
46 | public void run() {
47 | try {
48 | FormBody.Builder params = new FormBody.Builder();
49 | params.add("id", getIntent().getStringExtra("id"));
50 | params.add("passWord", et_password.getText().toString().trim());
51 | OkHttpClient okHttpClient = new OkHttpClient();
52 | //创造http请求
53 | Request request = new Request.Builder()
54 | .url(AppConfig.BASE_URl + "/updatePassword")
55 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
56 | .post(params.build())
57 | .build();
58 | //执行发送的指令
59 | Response response = okHttpClient.newCall(request).execute();
60 | runOnUiThread(new Runnable() {
61 | @Override
62 | public void run() {
63 | Toast.makeText(UpdatePwordActivity.this, "重置密码成功!", Toast.LENGTH_SHORT).show();
64 | }
65 | });
66 | } catch (Exception e) {
67 | e.printStackTrace();
68 | }
69 | }
70 | }).start();
71 | }
72 | });
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/register/RegisterActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.register;
2 |
3 | import android.os.Bundle;
4 | import android.provider.SyncStateContract;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.EditText;
8 | import android.widget.Toast;
9 |
10 | import androidx.appcompat.app.AppCompatActivity;
11 |
12 | import com.example.coalreport.R;
13 | import com.example.coalreport.login.LoginActivity;
14 | import com.example.coalreport.utils.AppConfig;
15 |
16 | import com.example.coalreport.utils.StringUtils;
17 |
18 | import org.json.JSONArray;
19 | import org.json.JSONObject;
20 |
21 | import okhttp3.FormBody;
22 | import okhttp3.MediaType;
23 | import okhttp3.OkHttpClient;
24 | import okhttp3.Request;
25 | import okhttp3.RequestBody;
26 | import okhttp3.Response;
27 |
28 |
29 | /**
30 | * @author a-cper-cpu
31 | * 注册界面
32 | */
33 |
34 |
35 | public class RegisterActivity extends AppCompatActivity {
36 |
37 |
38 | private Button btn_register;
39 | private EditText et_account;
40 | private EditText et_pwd;
41 | private String account;
42 | private String pwd;
43 |
44 |
45 | @Override
46 | protected void onCreate(Bundle savedInstanceState) {
47 | super.onCreate(savedInstanceState);
48 | setContentView(R.layout.activity_register);
49 | btn_register = findViewById(R.id.btn_register);
50 | et_account = findViewById(R.id.et_account);
51 | et_pwd = findViewById(R.id.et_pwd);
52 | btn_register.setOnClickListener(new View.OnClickListener() {
53 | @Override
54 | public void onClick(View v) {
55 | account = et_account.getText().toString().trim();
56 | pwd = et_pwd.getText().toString().trim();
57 | if (StringUtils.isEmpty(account)) {
58 | Toast.makeText(RegisterActivity.this, "请输入账号", Toast.LENGTH_SHORT).show();
59 | return;
60 | }
61 | if (StringUtils.isEmpty(pwd)) {
62 | Toast.makeText(RegisterActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
63 | return;
64 | }
65 | new Thread(new Runnable() {
66 | @Override
67 | public void run() {
68 | try {
69 | FormBody.Builder params = new FormBody.Builder();
70 | params.add("id", account);
71 | params.add("passWord", pwd);
72 | OkHttpClient okHttpClient = new OkHttpClient();
73 | //创造http请求
74 | Request request = new Request.Builder()
75 | .url(AppConfig.BASE_URl + "/register")
76 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
77 | .post(params.build())
78 | .build();
79 | //执行发送的指令
80 | Response response = okHttpClient.newCall(request).execute();
81 | runOnUiThread(new Runnable() {
82 | @Override
83 | public void run() {
84 | Toast.makeText(RegisterActivity.this, "注册成功", Toast.LENGTH_SHORT).show();
85 | }
86 | });
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | runOnUiThread(new Runnable() {
90 | @Override
91 | public void run() {
92 | Toast.makeText(RegisterActivity.this, "网络连接失败", Toast.LENGTH_SHORT).show();
93 | }
94 | });
95 | }
96 | }
97 | }).start();
98 | }
99 | });
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/releaseprogress/PhotoProgressActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.releaseprogress;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.webkit.WebView;
7 |
8 | import com.example.coalreport.R;
9 |
10 | import static com.example.coalreport.utils.AppConfig.BASE_PROGRESS_URl;
11 |
12 | /**
13 | * @author a-cper-cpu
14 | * 图片举报进展界面,webView加载网页
15 | * 后台服务器提供URL,app端加载显示
16 | */
17 |
18 |
19 | public class PhotoProgressActivity extends AppCompatActivity {
20 |
21 | private WebView webView;
22 |
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_photo_progress);
28 | webView = findViewById(R.id.webView_photo);
29 | webView.loadUrl(BASE_PROGRESS_URl+"/coalreport/photoreport/"+getIntent().getStringExtra("id"));
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/releaseprogress/ProgressActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.releaseprogress;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Button;
9 |
10 | import com.example.coalreport.R;
11 |
12 |
13 | /**
14 | * @author a-cper-cpu
15 | * 举报进展,三个按钮,分别跳转到文字举报进展、图片举报进展、视频举报进展
16 | */
17 |
18 | public class ProgressActivity extends AppCompatActivity {
19 |
20 | private Button btn_text;
21 | private Button btn_video;
22 | private Button btn_photo;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_progress);
28 | btn_video = findViewById(R.id.btn_progressvideo);
29 | btn_video.setOnClickListener(new View.OnClickListener() {
30 | @Override
31 | public void onClick(View v) {
32 | Intent it3 = new Intent(ProgressActivity.this, VideoProgressActivity.class);
33 | it3.putExtra("id", getIntent().getStringExtra("id"));
34 | startActivity(it3);
35 | }
36 | });
37 |
38 | btn_text = findViewById(R.id.btn_progresstext);
39 | btn_text.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | Intent it3 = new Intent(ProgressActivity.this, TextProgressActivity.class);
43 | it3.putExtra("id", getIntent().getStringExtra("id"));
44 | startActivity(it3);
45 | }
46 | });
47 |
48 | btn_photo = findViewById(R.id.btn_progressphoto);
49 | btn_photo.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | Intent it3 = new Intent(ProgressActivity.this, PhotoProgressActivity.class);
53 | it3.putExtra("id", getIntent().getStringExtra("id"));
54 | startActivity(it3);
55 | }
56 | });
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/releaseprogress/TextProgressActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.releaseprogress;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.webkit.WebView;
7 |
8 | import com.example.coalreport.R;
9 |
10 | import static com.example.coalreport.utils.AppConfig.BASE_PROGRESS_URl;
11 |
12 |
13 | /**
14 | * @author a-cper-cpu
15 | * 文字举报进展界面,webView加载网页
16 | * 后台服务器提供URL,app端加载显示
17 | */
18 |
19 | public class TextProgressActivity extends AppCompatActivity {
20 |
21 | private WebView webView;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_text_progress);
27 | webView = findViewById(R.id.webView_text);
28 | webView.loadUrl(BASE_PROGRESS_URl + "/coalreport/textreport/" + getIntent().getStringExtra("id"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/releaseprogress/VideoProgressActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.releaseprogress;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 | import android.webkit.WebView;
7 |
8 | import com.example.coalreport.R;
9 |
10 | import static com.example.coalreport.utils.AppConfig.BASE_PROGRESS_URl;
11 |
12 |
13 | /**
14 | * @author a-cper-cpu
15 | * 视频举报进展界面,webView加载网页
16 | * 后台服务器提供URL,app端加载显示
17 | */
18 |
19 | public class VideoProgressActivity extends AppCompatActivity {
20 |
21 | private WebView webView;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_video_progress);
27 | webView = findViewById(R.id.webView_video);
28 | webView.loadUrl(BASE_PROGRESS_URl + "/coalreport/videoreport/" + getIntent().getStringExtra("id"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/releasetext/ReleaseTextActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.releasetext;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.Toast;
11 |
12 | import com.example.coalreport.R;
13 | import com.example.coalreport.fragment.ReleaseFragment;
14 | import com.example.coalreport.register.RegisterActivity;
15 | import com.example.coalreport.utils.AppConfig;
16 | import com.example.coalreport.utils.StringUtils;
17 |
18 | import java.text.SimpleDateFormat;
19 | import java.util.Date;
20 |
21 | import okhttp3.FormBody;
22 | import okhttp3.OkHttpClient;
23 | import okhttp3.Request;
24 | import okhttp3.Response;
25 |
26 | /**
27 | * @author a-cper-cpu
28 | * 发布文字举报界面
29 | */
30 |
31 | public class ReleaseTextActivity extends AppCompatActivity {
32 |
33 | private Button btn_quxiao;
34 | private Button btn_fabu;
35 | private EditText et_report;
36 |
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.activity_release_text);
42 |
43 | btn_quxiao = findViewById(R.id.btn_quxiao);
44 |
45 | btn_quxiao.setOnClickListener(new View.OnClickListener() {
46 | @Override
47 | public void onClick(View v) {
48 | finish();
49 | }
50 | });
51 | et_report = findViewById(R.id.et_report);
52 | btn_fabu = findViewById(R.id.btn_fabu);
53 | btn_fabu.setOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View v) {
56 | final String report = et_report.getText().toString().trim();
57 | if (StringUtils.isEmpty(report)) {
58 | Toast.makeText(ReleaseTextActivity.this, "举报内容为空!", Toast.LENGTH_SHORT).show();
59 | return;
60 | }
61 | new Thread(new Runnable() {
62 | @Override
63 | public void run() {
64 | try {
65 | Date dNow = new Date();
66 | SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
67 | FormBody.Builder params = new FormBody.Builder();
68 | params.add("id", getIntent().getStringExtra("id"));
69 | params.add("releaseText", report);
70 | params.add("releaseTime", ft.format(dNow));
71 | OkHttpClient okHttpClient = new OkHttpClient();
72 | //创造http请求
73 | Request request = new Request.Builder()
74 | .url(AppConfig.BASE_URl + "/releaseText")
75 | // .post(RequestBody.create(MediaType.parse("application/json"),json)).build();
76 | .post(params.build())
77 | .build();
78 | //执行发送的指令
79 | Response response = okHttpClient.newCall(request).execute();
80 | runOnUiThread(new Runnable() {
81 | @Override
82 | public void run() {
83 | Toast.makeText(ReleaseTextActivity.this, "发布成功", Toast.LENGTH_SHORT).show();
84 | et_report.setText(null);
85 | }
86 | });
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | runOnUiThread(new Runnable() {
90 | @Override
91 | public void run() {
92 | Toast.makeText(ReleaseTextActivity.this, "发布失败", Toast.LENGTH_SHORT).show();
93 | }
94 | });
95 | }
96 | }
97 | }).start();
98 | }
99 | });
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/utils/AppConfig.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.utils;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 后台服务器访问地址
7 | */
8 |
9 | public class AppConfig {
10 |
11 | //后台操作数据库服务器的访问地址
12 | public static final String BASE_URl = "http://127.0.0.1:8089";
13 | //举报进展服务器的访问地址
14 | public static final String BASE_PROGRESS_URl = "http://127.0.0.1:8087";
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/utils/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.utils;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.os.Looper;
8 | import android.widget.Toast;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.annotation.Nullable;
12 | import androidx.appcompat.app.AppCompatActivity;
13 | import androidx.appcompat.app.AppCompatDelegate;
14 | import org.xutils.x;
15 |
16 | /**
17 | * @author a-cper-cpu
18 | * 自己创建的activity,后续activity可以选择继承该activity
19 | */
20 |
21 | public abstract class BaseActivity extends AppCompatActivity {
22 | public Context mContext;
23 | @Override
24 | protected void onCreate(@Nullable Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | mContext = this;
27 | setContentView(initLayout());
28 | initView();
29 | initData();
30 | }
31 |
32 | protected abstract int initLayout();
33 |
34 | protected abstract void initView();
35 |
36 | protected abstract void initData();
37 |
38 | public void showToast(String msg) {
39 | Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
40 | }
41 |
42 | public void showToastSync(String msg) {
43 | Looper.prepare();
44 | Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
45 | Looper.loop();
46 | }
47 |
48 | public void navigateTo(Class cls) {
49 | Intent in = new Intent(mContext, cls);
50 | startActivity(in);
51 | }
52 |
53 | public void navigateToWithFlag(Class cls, int flags) {
54 | Intent in = new Intent(mContext, cls);
55 | in.setFlags(flags);
56 | startActivity(in);
57 | }
58 |
59 | protected void insertVal(String key, String val) {
60 | SharedPreferences sp = getSharedPreferences("sp_ttit", MODE_PRIVATE);
61 | SharedPreferences.Editor editor = sp.edit();
62 | editor.putString(key, val);
63 | editor.commit();
64 | }
65 |
66 | protected String findByKey(String key) {
67 | SharedPreferences sp = getSharedPreferences("sp_ttit", MODE_PRIVATE);
68 | return sp.getString(key, "");
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/utils/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.utils;
2 |
3 |
4 | /**
5 | * @author a-cper-cpu
6 | * 判断String是否为空
7 | */
8 |
9 | public class StringUtils {
10 | public static boolean isEmpty(String str) {
11 | if (str == null || str.length() <= 0) {
12 | return true;
13 | } else {
14 | return false;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/utils/Tag.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.utils;
2 |
3 | /**
4 | * 播放器标签
5 | */
6 | public final class Tag {
7 | //列表播放
8 | public static final String LIST = "list";
9 | //无缝播放
10 | public static final String SEAMLESS = "seamless";
11 | //画中画
12 | public static final String PIP = "pip";
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/utils/Utils.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.utils;
2 |
3 | import android.view.View;
4 | import android.view.ViewParent;
5 | import android.widget.FrameLayout;
6 |
7 | import com.dueeeke.videoplayer.player.VideoView;
8 | import com.dueeeke.videoplayer.player.VideoViewConfig;
9 | import com.dueeeke.videoplayer.player.VideoViewManager;
10 |
11 | import java.lang.reflect.Field;
12 |
13 | public final class Utils {
14 | private Utils() {
15 | }
16 |
17 |
18 | /**
19 | * 获取当前的播放核心
20 | */
21 | public static Object getCurrentPlayerFactory() {
22 | VideoViewConfig config = VideoViewManager.getConfig();
23 | Object playerFactory = null;
24 | try {
25 | Field mPlayerFactoryField = config.getClass().getDeclaredField("mPlayerFactory");
26 | mPlayerFactoryField.setAccessible(true);
27 | playerFactory = mPlayerFactoryField.get(config);
28 | } catch (Exception e) {
29 | e.printStackTrace();
30 | }
31 | return playerFactory;
32 | }
33 |
34 | /**
35 | * 将View从父控件中移除
36 | */
37 | public static void removeViewFormParent(View v) {
38 | if (v == null) return;
39 | ViewParent parent = v.getParent();
40 | if (parent instanceof FrameLayout) {
41 | ((FrameLayout) parent).removeView(v);
42 | }
43 | }
44 |
45 | /**
46 | * Returns a string containing player state debugging information.
47 | */
48 | public static String playState2str(int state) {
49 | String playStateString;
50 | switch (state) {
51 | default:
52 | case VideoView.STATE_IDLE:
53 | playStateString = "idle";
54 | break;
55 | case VideoView.STATE_PREPARING:
56 | playStateString = "preparing";
57 | break;
58 | case VideoView.STATE_PREPARED:
59 | playStateString = "prepared";
60 | break;
61 | case VideoView.STATE_PLAYING:
62 | playStateString = "playing";
63 | break;
64 | case VideoView.STATE_PAUSED:
65 | playStateString = "pause";
66 | break;
67 | case VideoView.STATE_BUFFERING:
68 | playStateString = "buffering";
69 | break;
70 | case VideoView.STATE_BUFFERED:
71 | playStateString = "buffered";
72 | break;
73 | case VideoView.STATE_PLAYBACK_COMPLETED:
74 | playStateString = "playback completed";
75 | break;
76 | case VideoView.STATE_ERROR:
77 | playStateString = "error";
78 | break;
79 | }
80 | return String.format("playState: %s", playStateString);
81 | }
82 |
83 | /**
84 | * Returns a string containing player state debugging information.
85 | */
86 | public static String playerState2str(int state) {
87 | String playerStateString;
88 | switch (state) {
89 | default:
90 | case VideoView.PLAYER_NORMAL:
91 | playerStateString = "normal";
92 | break;
93 | case VideoView.PLAYER_FULL_SCREEN:
94 | playerStateString = "full screen";
95 | break;
96 | case VideoView.PLAYER_TINY_SCREEN:
97 | playerStateString = "tiny screen";
98 | break;
99 | }
100 | return String.format("playerState: %s", playerStateString);
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/view/CircleTransform.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.view;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.BitmapShader;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 |
8 | import com.squareup.picasso.Transformation;
9 |
10 |
11 | /**
12 | * @author a-cper-cpu
13 | * 转换为圆形图片
14 | */
15 |
16 | public class CircleTransform implements Transformation {
17 |
18 | @Override
19 | public Bitmap transform(Bitmap source) {
20 | int size = Math.min(source.getWidth(), source.getHeight());
21 | int x = (source.getWidth() - size) / 2;
22 | int y = (source.getHeight() - size) / 2;
23 | Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size);
24 | if (squaredBitmap != source) {
25 | source.recycle();
26 | }
27 | Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig());
28 | Canvas canvas = new Canvas(bitmap);
29 | Paint paint = new Paint();
30 | BitmapShader shader = new BitmapShader(squaredBitmap,
31 | BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
32 | paint.setShader(shader);
33 | paint.setAntiAlias(true);
34 | float r = size / 2f;
35 | canvas.drawCircle(r, r, r, paint);
36 | squaredBitmap.recycle();
37 | return bitmap;
38 | }
39 |
40 | @Override
41 | public String key() {
42 | return "circle";
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/view/FixedViewPager.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.annotation.Nullable;
8 | import androidx.viewpager.widget.ViewPager;
9 |
10 | /**
11 | * @author a-cper-cpu
12 | * 自定义ViewPager
13 | */
14 |
15 | public class FixedViewPager extends ViewPager {
16 | public FixedViewPager(@NonNull Context context) {
17 | super(context);
18 | }
19 |
20 | public FixedViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | @Override
25 | public void setCurrentItem(int item) {
26 | super.setCurrentItem(item, false);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/welcome/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.welcome;
2 |
3 | import android.app.Activity;
4 | import android.os.Build;
5 | import android.os.Bundle;
6 | import android.view.WindowManager;
7 |
8 | import androidx.annotation.Nullable;
9 |
10 |
11 | /**
12 | * @author a-cper-cpu
13 | */
14 |
15 | public class BaseActivity extends Activity {
16 | @Override
17 | protected void onCreate(@Nullable Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setTranslucent(this);
20 | }
21 |
22 | public static void setTranslucent(Activity activity) {
23 | // 如果sdk版本大于19则设置状态栏透明化 则设置状态栏透明
24 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
25 | // 设置状态栏透明
26 | activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/welcome/InitAdvActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.welcome;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.os.Handler;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.LinearLayout;
11 |
12 |
13 | import com.example.coalreport.R;
14 | import com.example.coalreport.login.StartActivity;
15 |
16 |
17 | import java.util.Random;
18 |
19 | /**
20 | * @author a-cper-cpu
21 | */
22 |
23 | public class InitAdvActivity extends BaseActivity {
24 | private int[] picsLayout = {R.layout.layout_hello, R.layout.layout_hello2,
25 | R.layout.layout_hello3, R.layout.layout_hello4, R.layout.layout_hello5};
26 | private int i;
27 | private int count = 5;
28 | private Button mBtnSkip;
29 |
30 |
31 | @SuppressLint("HandlerLeak")
32 | private Handler handler = new Handler() {
33 | public void handleMessage(android.os.Message msg) {
34 | if (msg.what == 0) {
35 | mBtnSkip.setText("跳过 (" + getCount() + ")");
36 | //指定1000毫秒后发送空消息
37 | handler.sendEmptyMessageDelayed(0, 1000);
38 | }
39 | }
40 | };
41 | private LinearLayout linearLayout;
42 |
43 | protected void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | Random r = new Random();
46 | i = r.nextInt(10);
47 | // Log.i("test", "随机数是:" + i);
48 | if (i < 5) {
49 | //随机概率会出现广告页
50 | setContentView(R.layout.activity_adv);
51 | initView2();
52 | } else {
53 | startActivity(new Intent(InitAdvActivity.this, StartActivity.class));
54 | finish();
55 | }
56 | }
57 |
58 | private void initView2() {
59 | linearLayout = findViewById(R.id.advLine);
60 | View view = View.inflate(InitAdvActivity.this, picsLayout[i], null);
61 | linearLayout.addView(view);
62 | mBtnSkip = view.findViewById(R.id.btn_skip);
63 | mBtnSkip.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View view) {
66 | startActivity(new Intent(InitAdvActivity.this, StartActivity.class));
67 | handler.removeMessages(0);
68 | finish();
69 | }
70 | });
71 | handler.sendEmptyMessageDelayed(0, 1000);
72 | }
73 |
74 | public int getCount() {
75 | count--;
76 | if (count == 0) {
77 | Intent intent = new Intent(this, StartActivity.class);
78 | startActivity(intent);
79 | finish();
80 | }
81 | return count;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/coalreport/welcome/StartPageActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport.welcome;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 |
6 | public class StartPageActivity extends BaseActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | Thread myThread = new Thread() {//创建子线程
12 | @Override
13 | public void run() {
14 | try {
15 | sleep(1000);//使程序休眠一秒
16 | Intent it = new Intent(getApplicationContext(), InitAdvActivity.class);
17 | startActivity(it);
18 | finish();//关闭当前活动
19 | } catch (Exception e) {
20 | e.printStackTrace();
21 | }
22 | }
23 | };
24 | myThread.start();//启动线程
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/btn_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/btn_01.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/login_bag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/login_bag.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/login_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/pic1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/pic1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/pic2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/pic2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/pic3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/pic3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/pic4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/pic4.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/pic5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/drawable-v24/pic5.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/selector_tabtext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_big_login_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_big_register_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_login_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_login_form.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 | -
17 |
20 |
21 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_register_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shape_search_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/skipshape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_assignment_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_person_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_web_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_my_info_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
22 |
23 |
27 |
28 |
33 |
34 |
35 |
40 |
41 |
46 |
47 |
51 |
52 |
57 |
58 |
59 |
64 |
65 |
70 |
71 |
77 |
78 |
83 |
84 |
85 |
90 |
91 |
96 |
97 |
103 |
104 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_adv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_daily_saying.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
30 |
31 |
35 |
36 |
51 |
52 |
58 |
59 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
32 |
33 |
38 |
39 |
43 |
44 |
54 |
55 |
56 |
62 |
63 |
68 |
69 |
73 |
74 |
85 |
86 |
87 |
88 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
22 |
23 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_photo_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
26 |
27 |
38 |
39 |
40 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_register.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
32 |
33 |
38 |
39 |
43 |
44 |
54 |
55 |
56 |
62 |
63 |
68 |
69 |
73 |
74 |
85 |
86 |
87 |
88 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_release_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
15 |
16 |
26 |
27 |
35 |
36 |
47 |
48 |
49 |
50 |
55 |
56 |
57 |
64 |
65 |
70 |
71 |
83 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_release_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
34 |
35 |
46 |
47 |
48 |
49 |
54 |
55 |
56 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_release_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
34 |
35 |
46 |
47 |
48 |
49 |
54 |
55 |
56 |
63 |
64 |
70 |
71 |
72 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_start.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
27 |
28 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_text_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_update_pword.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
31 |
32 |
33 |
39 |
40 |
45 |
46 |
50 |
51 |
62 |
63 |
64 |
65 |
66 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_video_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
26 |
27 |
32 |
33 |
43 |
44 |
45 |
46 |
57 |
58 |
59 |
60 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_release.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
17 |
18 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_photo_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
21 |
22 |
27 |
28 |
32 |
33 |
41 |
42 |
50 |
51 |
52 |
53 |
54 |
55 |
63 |
64 |
68 |
69 |
70 |
71 |
72 |
80 |
81 |
85 |
86 |
87 |
90 |
91 |
97 |
98 |
103 |
104 |
112 |
113 |
114 |
120 |
121 |
126 |
127 |
135 |
136 |
137 |
138 |
144 |
145 |
150 |
151 |
159 |
160 |
161 |
162 |
163 |
167 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_text_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
21 |
22 |
27 |
28 |
32 |
33 |
41 |
42 |
50 |
51 |
52 |
53 |
54 |
55 |
63 |
64 |
69 |
70 |
71 |
72 |
73 |
74 |
77 |
78 |
84 |
85 |
90 |
91 |
99 |
100 |
101 |
107 |
108 |
113 |
114 |
122 |
123 |
124 |
125 |
131 |
132 |
137 |
138 |
146 |
147 |
148 |
149 |
150 |
154 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_video_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
21 |
22 |
27 |
28 |
32 |
33 |
41 |
42 |
50 |
51 |
52 |
53 |
54 |
55 |
63 |
64 |
68 |
69 |
70 |
78 |
79 |
83 |
84 |
85 |
88 |
89 |
95 |
96 |
101 |
102 |
110 |
111 |
112 |
118 |
119 |
124 |
125 |
133 |
134 |
135 |
136 |
142 |
143 |
148 |
149 |
157 |
158 |
159 |
160 |
161 |
165 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_hello.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_hello2.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_hello3.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_hello4.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_hello5.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xhdpi/login.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/pwd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xhdpi/pwd.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/start_welcome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xhdpi/start_welcome.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/about.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/app_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/app_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/collect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/collect_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/collect_select.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/comment.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/dailyjubj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/dailyjubj.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/dianzan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/dianzan.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/dianzan_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/dianzan_select.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/header.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/home_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/home_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/home_unselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/home_unselect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/icon_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/icon_collect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/icon_left_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/icon_left_arrow.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/icon_skin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/icon_skin.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/logout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/logout.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/my_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/my_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/my_unselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/my_unselect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/releasebag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/releasebag.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/releasepg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/releasepg.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/search.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/send_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/send_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/send_unselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/send_unselect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/updatepword.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/app/src/main/res/mipmap-xxxhdpi/updatepword.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #109BAB
4 | #F44336
5 | #FFEB3B
6 | #00BCD4
7 | #3F51B5
8 | #303F9F
9 | #FF4081
10 | #FFFFFF
11 | #26B8EE
12 | #fdfdfd
13 | #cfdfd3
14 | #2E4D4D
15 | #8f8f8f
16 | #000000
17 | #e8e7e7
18 | #ffffff
19 | #344261
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 煤检举
3 | 首页
4 | 发布
5 | 我的
6 | 登录
7 | 注册
8 | 密码:
9 | 用户名:
10 | 请输入用户名
11 | 请输入密码
12 | SIGN UP
13 |
14 | Hello blank fragment
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/coalreport/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.coalreport;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.2'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | maven { url 'https://jitpack.io' }
21 |
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/a-cper-cpu/CoalReport/285a9497c96398c497f0f5860350ba66c159a2a8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue May 18 16:34:45 CST 2021
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-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name='CoalReport'
3 |
--------------------------------------------------------------------------------