parent
							
								
									a8bdc1609d
								
							
						
					
					
						commit
						ba2e3c0cfc
					
				| @ -0,0 +1,15 @@ | ||||
| *.iml | ||||
| .gradle | ||||
| /local.properties | ||||
| /.idea/caches | ||||
| /.idea/libraries | ||||
| /.idea/modules.xml | ||||
| /.idea/workspace.xml | ||||
| /.idea/navEditor.xml | ||||
| /.idea/assetWizardSettings.xml | ||||
| .DS_Store | ||||
| /build | ||||
| /captures | ||||
| .externalNativeBuild | ||||
| .cxx | ||||
| local.properties | ||||
| @ -0,0 +1,3 @@ | ||||
| # Default ignored files | ||||
| /shelf/ | ||||
| /workspace.xml | ||||
| @ -0,0 +1 @@ | ||||
| learnhelper | ||||
| @ -0,0 +1,6 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="CompilerConfiguration"> | ||||
|     <bytecodeTargetLevel target="11" /> | ||||
|   </component> | ||||
| </project> | ||||
| @ -0,0 +1,20 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="GradleMigrationSettings" migrationVersion="1" /> | ||||
|   <component name="GradleSettings"> | ||||
|     <option name="linkedExternalProjectsSettings"> | ||||
|       <GradleProjectSettings> | ||||
|         <option name="testRunner" value="GRADLE" /> | ||||
|         <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||||
|         <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||||
|         <option name="modules"> | ||||
|           <set> | ||||
|             <option value="$PROJECT_DIR$" /> | ||||
|             <option value="$PROJECT_DIR$/app" /> | ||||
|           </set> | ||||
|         </option> | ||||
|         <option name="resolveModulePerSourceSet" value="false" /> | ||||
|       </GradleProjectSettings> | ||||
|     </option> | ||||
|   </component> | ||||
| </project> | ||||
| @ -0,0 +1,50 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="RemoteRepositoriesConfiguration"> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="central" /> | ||||
|       <option name="name" value="Maven Central repository" /> | ||||
|       <option name="url" value="https://repo1.maven.org/maven2" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="jboss.community" /> | ||||
|       <option name="name" value="JBoss Community repository" /> | ||||
|       <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="maven3" /> | ||||
|       <option name="name" value="maven3" /> | ||||
|       <option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="MavenRepo" /> | ||||
|       <option name="name" value="MavenRepo" /> | ||||
|       <option name="url" value="https://repo.maven.apache.org/maven2/" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="BintrayJCenter" /> | ||||
|       <option name="name" value="BintrayJCenter" /> | ||||
|       <option name="url" value="https://jcenter.bintray.com/" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="maven2" /> | ||||
|       <option name="name" value="maven2" /> | ||||
|       <option name="url" value="https://maven.fabric.io/public" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="maven4" /> | ||||
|       <option name="name" value="maven4" /> | ||||
|       <option name="url" value="https://developer.huawei.com/repo/" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="maven" /> | ||||
|       <option name="name" value="maven" /> | ||||
|       <option name="url" value="https://jitpack.io" /> | ||||
|     </remote-repository> | ||||
|     <remote-repository> | ||||
|       <option name="id" value="Google" /> | ||||
|       <option name="name" value="Google" /> | ||||
|       <option name="url" value="https://dl.google.com/dl/android/maven2/" /> | ||||
|     </remote-repository> | ||||
|   </component> | ||||
| </project> | ||||
| @ -0,0 +1,29 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <project version="4"> | ||||
|   <component name="DesignSurface"> | ||||
|     <option name="filePathToZoomLevelMap"> | ||||
|       <map> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/btn_red_bg_4.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/corners_item_shape_white_202000.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/corners_org_item_shape.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/corners_org_item_with.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/ic_launcher_background.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/main_rbtn_textcolor.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/drawable/rounded_button.xml" value="0.215625" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/layout/activity_add_table.xml" value="0.1068840579710145" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/layout/activity_login.xml" value="0.1068840579710145" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/layout/base_activity_layout.xml" value="0.1068840579710145" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/layout/table_item_layout.xml" value="0.1068840579710145" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/layout/tip_dialog_layout.xml" value="0.1068840579710145" /> | ||||
|         <entry key="..\:/Users/15240/Desktop/assistance/assistance/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.215625" /> | ||||
|       </map> | ||||
|     </option> | ||||
|   </component> | ||||
|   <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK"> | ||||
|     <output url="file://$PROJECT_DIR$/build/classes" /> | ||||
|   </component> | ||||
|   <component name="ProjectType"> | ||||
|     <option name="id" value="Android" /> | ||||
|   </component> | ||||
| </project> | ||||
| @ -0,0 +1 @@ | ||||
| /build | ||||
| @ -0,0 +1,71 @@ | ||||
| plugins { | ||||
|     id 'com.android.application' | ||||
| } | ||||
| //apply plugin: 'com.android.application' | ||||
| android { | ||||
|     compileSdkVersion 30 | ||||
|     buildToolsVersion "30.0.2" | ||||
| 
 | ||||
|     defaultConfig { | ||||
|         applicationId "com.stu.assistant" | ||||
|         minSdkVersion 16 | ||||
|         targetSdkVersion 30 | ||||
|         versionCode 1 | ||||
|         versionName "1.0.0" | ||||
| 
 | ||||
|         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
|     } | ||||
| 
 | ||||
|     buildTypes { | ||||
|         release { | ||||
|             minifyEnabled false | ||||
|             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||||
|         } | ||||
|     } | ||||
|     compileOptions { | ||||
|         sourceCompatibility JavaVersion.VERSION_1_8 | ||||
|         targetCompatibility JavaVersion.VERSION_1_8 | ||||
|     } | ||||
| 
 | ||||
|     signingConfigs { | ||||
|         release { | ||||
|             storeFile file('I:\\code\\OtherAPP\\ScanCode\\standard.jks') | ||||
|             storePassword 'cpscapp' | ||||
|             keyAlias 'app' | ||||
|             keyPassword 'cpscapp' | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| dependencies { | ||||
| 
 | ||||
|     implementation 'androidx.appcompat:appcompat:1.1.0' | ||||
|     implementation 'com.google.android.material:material:1.1.0' | ||||
|     implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||||
|     testImplementation 'junit:junit:4.+' | ||||
|     androidTestImplementation 'androidx.test.ext:junit:1.1.1' | ||||
|     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||||
| 
 | ||||
|     implementation 'androidx.legacy:legacy-support-v4:1.0.0' | ||||
|     implementation 'androidx.recyclerview:recyclerview:1.1.0' | ||||
|     implementation 'com.gyf.immersionbar:immersionbar:3.0.0' | ||||
| //    implementation 'com.android.support:multidex:1.0.2' | ||||
| //    implementation 'com.google.code.gson:gson:2.8.2' | ||||
|     implementation 'com.contrarywind:Android-PickerView:4.1.6'//时间选择器 | ||||
|     implementation 'com.androidkun:XTabLayout:1.1.3' | ||||
|     implementation 'com.github.bumptech.glide:glide:4.8.0' | ||||
|     annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' | ||||
|     implementation 'com.lzy.net:okgo:3.0.4' | ||||
|     implementation 'com.lzy.net:okrx2:2.0.2' | ||||
|     implementation 'com.tencent.bugly:crashreport:latest.release' | ||||
|     implementation 'com.yanyusong.y_divideritemdecoration:y_divideritemdecoration:2.0' | ||||
| //    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' | ||||
| //    implementation 'com.jakewharton:butterknife:10.2.1' | ||||
| 
 | ||||
|     implementation 'io.github.bmob:android-sdk:3.8.11' | ||||
|     implementation 'io.reactivex.rxjava2:rxjava:2.2.8' | ||||
|     implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' | ||||
|     implementation 'com.squareup.okhttp3:okhttp:4.8.1' | ||||
|     implementation 'com.squareup.okio:okio:2.2.2' | ||||
|     implementation 'com.google.code.gson:gson:2.8.5' | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| # 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 | ||||
| @ -0,0 +1,26 @@ | ||||
| package com.stu.assistant; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| 
 | ||||
| import androidx.test.platform.app.InstrumentationRegistry; | ||||
| import androidx.test.ext.junit.runners.AndroidJUnit4; | ||||
| 
 | ||||
| import org.junit.Test; | ||||
| import org.junit.runner.RunWith; | ||||
| 
 | ||||
| import static org.junit.Assert.*; | ||||
| 
 | ||||
| /** | ||||
|  * Instrumented test, which will execute on an Android device. | ||||
|  * | ||||
|  * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||||
|  */ | ||||
| @RunWith(AndroidJUnit4.class) | ||||
| public class ExampleInstrumentedTest { | ||||
|     @Test | ||||
|     public void useAppContext() { | ||||
|         // Context of the app under test.
 | ||||
|         Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||||
|         assertEquals("com.stf.scancode", appContext.getPackageName()); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,333 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.recyclerview.widget.LinearLayoutManager; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; | ||||
| import cn.bmob.v3.BmobQuery; | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.FindListener; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.os.Handler; | ||||
| import android.text.TextUtils; | ||||
| import android.view.View; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.adapter.TableListAdapter; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.AllTableListBean; | ||||
| import com.stu.assistant.bean.TableBean; | ||||
| import com.stu.assistant.constants.ConstansTableItemManager; | ||||
| import com.stu.assistant.uitls.CalendarUtil; | ||||
| import com.stu.assistant.uitls.DividerItemDecoration0Util; | ||||
| import com.stu.assistant.uitls.LogUtils; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedNoClearUtil; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| import com.stu.assistant.view.MySwipeRefreshLayout; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| //添加课程表的页面
 | ||||
| public class AddTableActivity extends BaseActivity { | ||||
|     private RecyclerView mrv; | ||||
|     private TableListAdapter adapter; | ||||
|     private MySwipeRefreshLayout swip; | ||||
|     private Handler handler; | ||||
|     private ArrayList<TableBean> mList1; | ||||
|     private ArrayList<TableBean> mList2; | ||||
|     private ArrayList<TableBean> mList3; | ||||
|     private ArrayList<TableBean> mList4; | ||||
|     private ArrayList<TableBean> mList5; | ||||
|     private TextView okBtn; | ||||
|     private AllTableListBean bean; | ||||
|     private int index = -1;//是否存在课程表id 的下标
 | ||||
|     private LinearLayout backLay, lay; | ||||
|     private TextView titleTv; | ||||
|     private String tableIdMsg; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_add_table; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         Intent intent = getIntent(); | ||||
|         bean = (AllTableListBean) intent.getSerializableExtra("bean"); | ||||
| 
 | ||||
|         swip = findViewById(R.id.swip_rf); | ||||
|         mrv = findViewById(R.id.mrv); | ||||
|         okBtn = findViewById(R.id.other_tv); | ||||
|         titleTv = findViewById(R.id.title_tv); | ||||
|         backLay = findViewById(R.id.back_lay); | ||||
|         lay = findViewById(R.id.lay); | ||||
|         handler = new Handler(); | ||||
| 
 | ||||
|         if (bean == null) { | ||||
|             titleTv.setText("新建课表"); | ||||
|             tableIdMsg = CalendarUtil.getInstance().getYMDHMSLine(); | ||||
|         } else { | ||||
|             titleTv.setText("课表详情"); | ||||
|             tableIdMsg = bean.getTableIdMsg(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         LinearLayoutManager manager = new LinearLayoutManager(this); | ||||
|         manager.setOrientation(LinearLayoutManager.VERTICAL); | ||||
|         mrv.addItemDecoration(new DividerItemDecoration0Util(this, false)); | ||||
|         mrv.setLayoutManager(manager); | ||||
|         String string = SharedNoClearUtil.create(BaseApplion.application).getString(SharedConfig.isBg, SharedConfig.isBg_1); | ||||
|         if (string.equals(SharedConfig.isBg_1)) { | ||||
|             lay.setBackgroundResource(R.mipmap.ic_bg_1); | ||||
|         } | ||||
|         if (string.equals(SharedConfig.isBg_2)) { | ||||
|             lay.setBackgroundResource(R.mipmap.ic_bg_2); | ||||
|         } | ||||
|         if (string.equals(SharedConfig.isBg_3)) { | ||||
|             lay.setBackgroundResource(R.mipmap.ic_bg_3); | ||||
|         } | ||||
|         if (string.equals(SharedConfig.isBg_4)) { | ||||
|             lay.setBackgroundResource(R.mipmap.ic_bg_4); | ||||
|         } | ||||
|         getData(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         // 刷新数据
 | ||||
|         swip.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | ||||
|             @Override | ||||
|             public void onRefresh() { | ||||
|                 // 这里的作用是防止下拉刷新的时候还可以上拉加载
 | ||||
|                 getData(); | ||||
|             } | ||||
|         }); | ||||
|         okBtn.setOnClickListener(new View.OnClickListener() { | ||||
| 
 | ||||
|             private String tableIdMsg; | ||||
| 
 | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 saveData(2); | ||||
|             } | ||||
|         }); | ||||
|         backLay.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 showBackDialog(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     //保存数据
 | ||||
|     private void saveData(int num) { | ||||
|         ArrayList<TableBean> allList = new ArrayList<>(); | ||||
|         allList.addAll(mList1); | ||||
|         allList.addAll(mList2); | ||||
|         allList.addAll(mList3); | ||||
|         allList.addAll(mList4); | ||||
|         allList.addAll(mList5); | ||||
| 
 | ||||
|         for (int i = 0; i < allList.size(); i++) { | ||||
|             String tableIdMsg = allList.get(i).getTableIdMsg(); | ||||
|             if (!TextUtils.isEmpty(tableIdMsg)) { | ||||
|                 index = i; | ||||
|                 break; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (num == 2) { | ||||
|             if (index == -1) { | ||||
|                 MyToast.show("请添加课程"); | ||||
|                 return; | ||||
|             } | ||||
|         } else { | ||||
|             if (index == -1) { | ||||
|                 finish(); | ||||
|                 return; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (index != -1) { | ||||
|             String tableIdMsg = allList.get(index).getTableIdMsg(); | ||||
|             showProDialog("正在提交"); | ||||
|             AllTableListBean allTableListBean = new AllTableListBean(); | ||||
|             allTableListBean.setTableIdMsg(tableIdMsg); | ||||
|             allTableListBean.setStuId(SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|             allTableListBean.save(new SaveListener<String>() { | ||||
|                 @Override | ||||
|                 public void done(String s, BmobException e) { | ||||
|                     dismissProDialog(); | ||||
|                     if (e == null) { | ||||
|                         MyToast.show("成功"); | ||||
|                         setResult(12); | ||||
|                         finish(); | ||||
|                     } else { | ||||
|                         MyToast.show("失败:" + e.getMessage() + "," + e.getErrorCode()); | ||||
|                     } | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void getData() { | ||||
|         getNewData();//初始化课程表数据
 | ||||
|         if (bean == null) {//新建
 | ||||
|             setAdapter(mList1, mList2, mList3, mList4, mList5); | ||||
|         } else {//查看详情
 | ||||
|             showProDialog("正在查询"); | ||||
|             BmobQuery<TableBean> query = new BmobQuery<>(); | ||||
|             query.addWhereEqualTo("tableIdMsg", bean.getTableIdMsg()); | ||||
|             query.findObjects(new FindListener<TableBean>() { | ||||
|                 @Override | ||||
|                 public void done(List<TableBean> list, BmobException e) { | ||||
|                     LogUtils.i("list", "-stuId-findObjects-->" + new Gson().toJson(list)); | ||||
|                     dismissProDialog(); | ||||
|                     if (list == null) { | ||||
|                         MyToast.show("暂无数据"); | ||||
|                     } else { | ||||
|                         optList(list); | ||||
|                     } | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     //初始化数据
 | ||||
|     private void getNewData() { | ||||
|         mList1 = new ArrayList<>(); | ||||
|         mList2 = new ArrayList<>(); | ||||
|         mList3 = new ArrayList<>(); | ||||
|         mList4 = new ArrayList<>(); | ||||
|         mList5 = new ArrayList<>(); | ||||
| 
 | ||||
|         TableBean tableBean = new TableBean(); | ||||
|         tableBean.setTableNameMsg(""); | ||||
|         tableBean.setTeacherName(""); | ||||
|         tableBean.setAddress(""); | ||||
|         tableBean.setTeacherId(""); | ||||
|         for (int i = 0; i < 8; i++) { | ||||
|             mList1.add(tableBean); | ||||
|             mList2.add(tableBean); | ||||
|             mList3.add(tableBean); | ||||
|             mList4.add(tableBean); | ||||
|             mList5.add(tableBean); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // 拼装成课程表需要的格式
 | ||||
|     private void optList(List<TableBean> list) { | ||||
|         for (int i = 0; i < list.size(); i++) { | ||||
|             TableBean bean = list.get(i); | ||||
|             if (bean.getDay() == ConstansTableItemManager.item_1) { | ||||
|                 mList1.set(bean.getPos(), bean); | ||||
|             } | ||||
|             if (bean.getDay() == ConstansTableItemManager.item_2) { | ||||
|                 mList2.set(bean.getPos(), bean); | ||||
|             } | ||||
|             if (bean.getDay() == ConstansTableItemManager.item_3) { | ||||
|                 mList3.set(bean.getPos(), bean); | ||||
|             } | ||||
|             if (bean.getDay() == ConstansTableItemManager.item_4) { | ||||
|                 mList4.set(bean.getPos(), bean); | ||||
|             } | ||||
|             if (bean.getDay() == ConstansTableItemManager.item_5) { | ||||
|                 mList5.set(bean.getPos(), bean); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         setAdapter((ArrayList<TableBean>) mList1, (ArrayList<TableBean>) mList2, (ArrayList<TableBean>) mList3, (ArrayList<TableBean>) mList4, (ArrayList<TableBean>) mList5); | ||||
|     } | ||||
| 
 | ||||
|     public void setAdapter(ArrayList<TableBean> mList1, ArrayList<TableBean> mList2, ArrayList<TableBean> mList3, ArrayList<TableBean> mList4, ArrayList<TableBean> mList5) { | ||||
| 
 | ||||
|         if (adapter == null) { | ||||
|             adapter = new TableListAdapter(this); | ||||
|             adapter.setList(mList1, mList2, mList3, mList4, mList5); | ||||
|             mrv.setAdapter(adapter); | ||||
|             adapter.setOnItemClickListeners(new TableListAdapter.OnItemClickListeners() { | ||||
|                 @Override | ||||
|                 public void itemBean(int pos, TableBean tableBean, int day) { | ||||
|                     tableBean.setDay(day); | ||||
|                     tableBean.setPos(pos); | ||||
|                     Intent intent = new Intent(AddTableActivity.this, AddTableDialogActivity.class); | ||||
|                     if (bean == null) {//新增 是相对课程表说的
 | ||||
|                         intent.putExtra("title", "1"); | ||||
|                     } else {//编辑
 | ||||
|                         intent.putExtra("title", "2"); | ||||
|                     } | ||||
|                     if (TextUtils.isEmpty(tableBean.getTableNameMsg())) {//新增  相当于 item说的
 | ||||
|                         intent.putExtra("item", "1"); | ||||
|                     } else {//编辑
 | ||||
|                         intent.putExtra("item", "2"); | ||||
|                     } | ||||
|                     tableBean.setTableIdMsg(tableIdMsg); | ||||
|                     intent.putExtra("bean", tableBean); | ||||
|                     startActivityForResult(intent, 202); | ||||
|                 } | ||||
|             }); | ||||
|         } else { | ||||
|             adapter.setList(mList1, mList2, mList3, mList4, mList5); | ||||
|             adapter.notifyDataSetChanged(); | ||||
|             handler.postDelayed(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     swip.setRefreshing(false); | ||||
|                 } | ||||
|             }, 1000); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         showBackDialog(); | ||||
|     } | ||||
| 
 | ||||
|     private void showBackDialog() { | ||||
|         if (bean != null) { | ||||
|             finish(); | ||||
|             return; | ||||
|         } | ||||
|         saveData(1); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | ||||
|         super.onActivityResult(requestCode, resultCode, data); | ||||
|         if (requestCode == 202) { | ||||
|             if (resultCode == 12) { | ||||
|                 TableBean bean = (TableBean) data.getSerializableExtra("bean"); | ||||
|                 int day = bean.getDay(); | ||||
|                 int pos = bean.getPos(); | ||||
|                 if (day == ConstansTableItemManager.item_1) { | ||||
|                     mList1.set(pos, bean); | ||||
|                 } | ||||
|                 if (day == ConstansTableItemManager.item_2) { | ||||
|                     mList2.set(pos, bean); | ||||
|                 } | ||||
|                 if (day == ConstansTableItemManager.item_3) { | ||||
|                     mList3.set(pos, bean); | ||||
|                 } | ||||
|                 if (day == ConstansTableItemManager.item_4) { | ||||
|                     mList4.set(pos, bean); | ||||
|                 } | ||||
|                 if (day == ConstansTableItemManager.item_5) { | ||||
|                     mList5.set(pos, bean); | ||||
|                 } | ||||
|                 setAdapter(mList1, mList2, mList3, mList4, mList5); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,218 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.text.TextUtils; | ||||
| import android.util.Log; | ||||
| import android.view.View; | ||||
| import android.widget.ArrayAdapter; | ||||
| import android.widget.EditText; | ||||
| import android.widget.Spinner; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.TableBean; | ||||
| import com.stu.assistant.bean.TableTimeBean; | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.constants.ConstansUserManager; | ||||
| import com.stu.assistant.uitls.CalendarUtil; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import java.sql.Array; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import cn.bmob.v3.BmobQuery; | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.FindListener; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| import cn.bmob.v3.listener.UpdateListener; | ||||
| 
 | ||||
| //添加具体的节课的页面
 | ||||
| public class AddTableDialogActivity extends BaseActivity { | ||||
| 
 | ||||
| 
 | ||||
|     private EditText tableNameEdit; | ||||
|     private EditText addressEdit, markEdit; | ||||
|     private Spinner spinner, spinnerDay, teacherNameSpinner; | ||||
|     private TableBean bean; | ||||
|     private ArrayList<UserInfoBean> teacherList; | ||||
|     private TextView btn; | ||||
|     private String item = "1"; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_add_table_dialog; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         Intent intent = getIntent(); | ||||
|         String title = intent.getStringExtra("title"); | ||||
|         item = intent.getStringExtra("item"); | ||||
|         String titleMsg = ""; | ||||
|         bean = (TableBean) intent.getSerializableExtra("bean"); | ||||
|         if (title.equals("1")) { | ||||
|             titleMsg = "新增课程"; | ||||
|         } else { | ||||
|             titleMsg = "编辑课程"; | ||||
|         } | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, titleMsg); | ||||
|         setTextMsg(R.id.OnPushClick, titleMsg); | ||||
|         tableNameEdit = findViewById(R.id.edit_table_name); | ||||
|         teacherNameSpinner = findViewById(R.id.edit_teacherName); | ||||
|         addressEdit = findViewById(R.id.edit_address); | ||||
|         markEdit = findViewById(R.id.edit_mark); | ||||
|         spinner = findViewById(R.id.spinner_time); | ||||
|         spinnerDay = findViewById(R.id.spinner_day); | ||||
|         btn = findViewById(R.id.OnPushClick); | ||||
|         spinner.setEnabled(false); | ||||
|         spinnerDay.setEnabled(false); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         spinnerDay.setSelection(bean.getDay()); | ||||
|         spinner.setSelection(bean.getPos() + 1); | ||||
|         if (!TextUtils.isEmpty(bean.getAddress())) { | ||||
|             addressEdit.setText(bean.getAddress()); | ||||
|         } | ||||
|         if (!TextUtils.isEmpty(bean.getTableNameMsg())) { | ||||
|             tableNameEdit.setText(bean.getTableNameMsg()); | ||||
|         } | ||||
| 
 | ||||
|         if (!TextUtils.isEmpty(bean.getMark())) { | ||||
|             markEdit.setText(bean.getMark()); | ||||
|         } | ||||
|         showProDialog("正在查询老师信息"); | ||||
|         BmobQuery<UserInfoBean> query = new BmobQuery<>(); | ||||
|         query.addWhereEqualTo("userLevel", ConstansUserManager.Level_3); | ||||
|         query.order("-createdAt") | ||||
|                 .findObjects(new FindListener<UserInfoBean>() { | ||||
|                     @Override | ||||
|                     public void done(List<UserInfoBean> list, BmobException e) { | ||||
|                         dismissProDialog(); | ||||
|                         teacherList = (ArrayList<UserInfoBean>) list; | ||||
|                         setSpinner(teacherList); | ||||
|                     } | ||||
|                 }); | ||||
|     } | ||||
| 
 | ||||
|     private void setSpinner(ArrayList<UserInfoBean> list) { | ||||
|         UserInfoBean userInfoBean = new UserInfoBean(); | ||||
|         userInfoBean.setUsername("请选择老师"); | ||||
|         list.add(0, userInfoBean); | ||||
|         String[] mItems = new String[list.size()]; | ||||
|         for (int i = 0; i < list.size(); i++) { | ||||
|             mItems[i] = list.get(i).getUsername(); | ||||
|         } | ||||
|         ArrayAdapter<String> _Adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mItems); | ||||
|         teacherNameSpinner.setAdapter(_Adapter); | ||||
|         //默认选择带过来的老师信息
 | ||||
|         if (!TextUtils.isEmpty(bean.getTeacherId())) { | ||||
|             for (int i = 0; i < list.size(); i++) { | ||||
|                 String objectId = list.get(i).getObjectId(); | ||||
|                 if (!TextUtils.isEmpty(objectId)) { | ||||
|                     if (objectId.equals(bean.getTeacherId())) { | ||||
|                         teacherNameSpinner.setSelection(i); | ||||
|                         break; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         btn.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 String tableNameMsg = tableNameEdit.getText().toString(); | ||||
|                 String addressMsg = addressEdit.getText().toString(); | ||||
|                 String markMsg = markEdit.getText().toString(); | ||||
|                 int teacherName = teacherNameSpinner.getSelectedItemPosition(); | ||||
|                 int selectedItemPosition = spinner.getSelectedItemPosition(); | ||||
|                 int selectedItemPosition1 = spinnerDay.getSelectedItemPosition(); | ||||
|                 if (teacherList == null) { | ||||
|                     MyToast.show("请重新加载老师信息"); | ||||
|                     return; | ||||
|                 } | ||||
|                 if (TextUtils.isEmpty(tableNameMsg)) { | ||||
|                     MyToast.show(tableNameEdit.getHint().toString()); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (TextUtils.isEmpty(addressMsg)) { | ||||
|                     MyToast.show(addressEdit.getHint().toString()); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (teacherName == 0) { | ||||
|                     MyToast.show("请选择老师"); | ||||
|                     return; | ||||
|                 } | ||||
|                 if (selectedItemPosition == 0) { | ||||
|                     MyToast.show("请选择周数"); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (selectedItemPosition1 == 0) { | ||||
|                     MyToast.show("请选择节次"); | ||||
|                     return; | ||||
|                 } | ||||
|                 bean.setTeacherId(teacherList.get(teacherName).getObjectId()); | ||||
|                 bean.setTeacherName(teacherList.get(teacherName).getUsername()); | ||||
|                 bean.setAddress(addressMsg); | ||||
|                 bean.setTableNameMsg(tableNameMsg); | ||||
|                 bean.setStuId(SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|                 bean.setMark(markMsg); | ||||
| //                Log.i("hx","--item-->"+item);
 | ||||
| //                Log.i("hx","--bean-->"+new Gson().toJson(bean));
 | ||||
|                 if (TextUtils.isEmpty(item) || item.equals("1")) {//直接返回一块更新
 | ||||
|                     showProDialog("正在保存"); | ||||
|                     bean.save(new SaveListener<String>() { | ||||
|                         @Override | ||||
|                         public void done(String s, BmobException e) { | ||||
|                             dismissProDialog(); | ||||
|                             if (e == null) { | ||||
|                                 Intent intent = new Intent(); | ||||
|                                 bean.setObjectId(s); | ||||
|                                 intent.putExtra("bean", bean); | ||||
|                                 setResult(12, intent); | ||||
|                                 finish(); | ||||
|                             } else { | ||||
|                                 MyToast.show("保存失败" + e.getMessage()); | ||||
|                             } | ||||
|                         } | ||||
|                     }); | ||||
|                 } else {//单独更新
 | ||||
|                     showProDialog("正在更新"); | ||||
|                     bean.update(bean.getObjectId(), new UpdateListener() { | ||||
|                         @Override | ||||
|                         public void done(BmobException e) { | ||||
|                             dismissProDialog(); | ||||
|                             if (e == null) { | ||||
|                                 Intent intent = new Intent(); | ||||
|                                 intent.putExtra("bean", bean); | ||||
|                                 setResult(12, intent); | ||||
|                                 finish(); | ||||
|                             } else { | ||||
|                                 MyToast.show("失败" + e.getMessage()); | ||||
|                             } | ||||
|                         } | ||||
|                     }); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         super.onBackPressed(); | ||||
|         finish(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,158 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.text.TextUtils; | ||||
| import android.util.Log; | ||||
| import android.view.View; | ||||
| import android.widget.EditText; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.TaskBean; | ||||
| import com.stu.assistant.dialog.DiaogUtil; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| import cn.bmob.v3.listener.UpdateListener; | ||||
| //添加作业页面
 | ||||
| public class AddTaskActivity extends BaseActivity { | ||||
|     private EditText taskNameEdit; | ||||
|     private EditText msgEdit; | ||||
|     private TaskBean bean; | ||||
|     private TextView btn, timeTv; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_add_task_dialog; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         Intent intent = getIntent(); | ||||
|         String title = intent.getStringExtra("title"); | ||||
|         String titleMsg = ""; | ||||
|         bean = (TaskBean) intent.getSerializableExtra("bean"); | ||||
|         if (bean == null) { | ||||
|             titleMsg = "新增作业"; | ||||
|         } else { | ||||
|             titleMsg = "编辑作业"; | ||||
|         } | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, titleMsg); | ||||
|         setTextMsg(R.id.OnPushClick, titleMsg); | ||||
|         taskNameEdit = findViewById(R.id.edit_task_name); | ||||
|         msgEdit = findViewById(R.id.edit_msg); | ||||
|         timeTv = findViewById(R.id.tv_time); | ||||
|         btn = findViewById(R.id.OnPushClick); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         if (bean != null) { | ||||
|             if (!TextUtils.isEmpty(bean.getTaskMsg())) { | ||||
|                 msgEdit.setText(bean.getTaskMsg()); | ||||
|             } | ||||
|             if (!TextUtils.isEmpty(bean.getTableNameMsg())) { | ||||
|                 taskNameEdit.setText(bean.getTableNameMsg()); | ||||
|             } | ||||
|             if (!TextUtils.isEmpty(bean.getTime())) { | ||||
|                 timeTv.setText(bean.getTime()); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         timeTv.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 DiaogUtil.showSelectTimeDialog(AddTaskActivity.this, new DiaogUtil.OnSelectLisenter() { | ||||
|                     @Override | ||||
|                     public void OnOkBtn(String time) { | ||||
|                         timeTv.setText(time); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         btn.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 String tableNameMsg = taskNameEdit.getText().toString(); | ||||
|                 String taskMsg = msgEdit.getText().toString(); | ||||
|                 String timeMsg = timeTv.getText().toString(); | ||||
|                 if (TextUtils.isEmpty(tableNameMsg)) { | ||||
|                     MyToast.show(taskNameEdit.getHint().toString()); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (TextUtils.isEmpty(timeMsg)) { | ||||
|                     MyToast.show(timeTv.getHint().toString()); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (TextUtils.isEmpty(taskMsg)) { | ||||
|                     MyToast.show(msgEdit.getHint().toString()); | ||||
|                     return; | ||||
|                 } | ||||
| 
 | ||||
|                 if (bean == null) {//直接返回一块更新
 | ||||
|                     TaskBean bean = new TaskBean(); | ||||
|                     bean.setTaskMsg(taskMsg); | ||||
|                     bean.setTime(timeMsg); | ||||
|                     bean.setTableNameMsg(tableNameMsg); | ||||
|                     bean.setStuId(SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|                     Log.i("hx", "--bean-->" + new Gson().toJson(bean)); | ||||
|                     showProDialog("正在保存"); | ||||
|                     bean.save(new SaveListener<String>() { | ||||
|                         @Override | ||||
|                         public void done(String s, BmobException e) { | ||||
|                             dismissProDialog(); | ||||
|                             if (e == null) { | ||||
|                                 Intent intent = new Intent(); | ||||
|                                 bean.setObjectId(s); | ||||
|                                 intent.putExtra("bean", bean); | ||||
|                                 setResult(12, intent); | ||||
|                                 finish(); | ||||
|                             } else { | ||||
|                                 MyToast.show("保存失败" + e.getMessage()); | ||||
|                             } | ||||
|                         } | ||||
|                     }); | ||||
|                 } else {//单独更新
 | ||||
|                     showProDialog("正在更新"); | ||||
|                     bean.setTaskMsg(taskMsg); | ||||
|                     bean.setTime(timeMsg); | ||||
|                     bean.setTableNameMsg(tableNameMsg); | ||||
|                     bean.setStuId(SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|                     Log.i("hx", "--bean-->" + new Gson().toJson(bean)); | ||||
|                     bean.update(bean.getObjectId(), new UpdateListener() { | ||||
|                         @Override | ||||
|                         public void done(BmobException e) { | ||||
|                             dismissProDialog(); | ||||
|                             if (e == null) { | ||||
|                                 Intent intent = new Intent(); | ||||
|                                 intent.putExtra("bean", bean); | ||||
|                                 setResult(12, intent); | ||||
|                                 finish(); | ||||
|                             } else { | ||||
|                                 MyToast.show("失败" + e.getMessage()); | ||||
|                             } | ||||
|                         } | ||||
|                     }); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         super.onBackPressed(); | ||||
|         finish(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,111 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.view.View; | ||||
| import android.widget.EditText; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.presenter.LoginPresenter; | ||||
| import com.stu.assistant.uitls.AppTools; | ||||
| import com.stu.assistant.uitls.ChenJingEditUil; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import cn.bmob.v3.BmobUser; | ||||
| //登录页面
 | ||||
| public class LoginActivity extends BaseActivity { | ||||
| 
 | ||||
|     private EditText usertNameEdit; | ||||
|     private EditText usertPasswordEdit; | ||||
|     private LoginPresenter loginPresenter; | ||||
|     private TextView loginBtn, versionNameTv; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_login; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         ChenJingEditUil.assistActivity(this); | ||||
|         usertNameEdit = findViewById(R.id.tv_username); | ||||
|         usertPasswordEdit = findViewById(R.id.tv_userpassword); | ||||
|         loginBtn = findViewById(R.id.button_login); | ||||
|         versionNameTv = findViewById(R.id.version_name); | ||||
|         loginPresenter = new LoginPresenter(this); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         versionNameTv.setText(AppTools.getVersionName(this)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         boolean aBoolean = SharedUtil.create(BaseApplion.application).getBoolean(SharedConfig.isLogin, false); | ||||
|         if (aBoolean) { | ||||
|             if (BmobUser.isLogin()) { | ||||
|                 UserInfoBean user = BmobUser.getCurrentUser(UserInfoBean.class); | ||||
|                 loginPresenter.saveUser(user); | ||||
|                 Intent intent = new Intent(LoginActivity.this, MainActivity.class); | ||||
|                 startActivity(intent); | ||||
|                 finish(); | ||||
|             } else { | ||||
|                 login(); | ||||
|             } | ||||
|         } else { | ||||
|             login(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void login() { | ||||
|         loginBtn.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 loginPresenter.loginIn(usertNameEdit.getText().toString(), usertPasswordEdit.getText().toString(), new LoginPresenter.OnLoginResultListener() { | ||||
|                     @Override | ||||
|                     public void isSucLogin(UserInfoBean bean) { | ||||
|                         Intent intent = new Intent(LoginActivity.this, MainActivity.class); | ||||
|                         startActivity(intent); | ||||
|                         finish(); | ||||
|                     } | ||||
| 
 | ||||
|                     @Override | ||||
|                     public void errorMsg(String msg) { | ||||
|                         MyToast.show(msg); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public void OnRegister(View view) { | ||||
|         Intent intent = new Intent(LoginActivity.this, RegisterActivity.class); | ||||
|         intent.putExtra("type", "1"); | ||||
|         startActivityForResult(intent, 99); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         super.onBackPressed(); | ||||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | ||||
|         super.onActivityResult(requestCode, resultCode, data); | ||||
|         if (requestCode == 99) { | ||||
|             if (resultCode == 2) { | ||||
|                 UserInfoBean userBean = (UserInfoBean) data.getSerializableExtra("userBean"); | ||||
|                 usertNameEdit.setText(userBean.getUsername()); | ||||
|                 usertPasswordEdit.setText(""); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,102 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.view.View; | ||||
| import android.widget.AdapterView; | ||||
| import android.widget.GridView; | ||||
| import android.widget.LinearLayout; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.adapter.HomeGvAdapter; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.MainModuleBean; | ||||
| import com.stu.assistant.constants.ConstansItemManager; | ||||
| import com.stu.assistant.presenter.MainPresenter; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| //主页面
 | ||||
| public class MainActivity extends BaseActivity { | ||||
| 
 | ||||
|     private LinearLayout lay; | ||||
|     private GridView gridView; | ||||
|     private MainPresenter mainPresenter; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_main; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, "学习助手"); | ||||
|         findViewById(R.id.back_lay).setVisibility(View.INVISIBLE); | ||||
|         gridView = findViewById(R.id.main_gridview); | ||||
|         lay = findViewById(R.id.lay); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         mainPresenter = new MainPresenter(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         HomeGvAdapter homeGvAdapter = new HomeGvAdapter(this, mainPresenter.getData()); | ||||
|         gridView.setAdapter(homeGvAdapter); | ||||
|         gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | ||||
|             @Override | ||||
|             public void onItemClick(AdapterView<?> parent, View view, int i, long l) { | ||||
|                 MainModuleBean moduleBean = ((MainModuleBean) parent.getAdapter().getItem(i)); | ||||
|                 int itemFlag = moduleBean.getItemFlag(); | ||||
|                 switch (itemFlag) { | ||||
|                     case ConstansItemManager.item_1: | ||||
|                         Intent intent1 = new Intent(mContext, TableListActivity.class); | ||||
|                         intent1.putExtra("userLevel", SharedUtil.create(BaseApplion.application).getString(SharedConfig.userLevel)); | ||||
|                         intent1.putExtra("title", "课表"); | ||||
|                         intent1.putExtra("itemType", itemFlag); | ||||
|                         startActivityForResult(intent1, 201);//查看课表
 | ||||
|                         break; | ||||
|                     case ConstansItemManager.item_2: | ||||
|                         Intent intent = new Intent(mContext, TaskListActivity.class); | ||||
|                         intent.putExtra("userLevel", SharedUtil.create(BaseApplion.application).getString(SharedConfig.userLevel)); | ||||
|                         intent.putExtra("title", "作业"); | ||||
|                         intent.putExtra("itemType", itemFlag); | ||||
|                         startActivityForResult(intent, 202);//查看课表
 | ||||
|                         break; | ||||
|                     case ConstansItemManager.item_3: | ||||
|                         Intent intent3 = new Intent(mContext, SettingActivity.class); | ||||
|                         startActivity(intent3);//设置
 | ||||
|                         finish(); | ||||
|                         break; | ||||
|                     default: | ||||
|                         break; | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     // 两次点击按钮之间的点击间隔不能少于1000毫秒
 | ||||
|     private static final int MIN_CLICK_DELAY_TIME = 2000; | ||||
|     private static long lastClickTime; | ||||
| 
 | ||||
|     public void outApp() { | ||||
|         long curClickTime = System.currentTimeMillis(); | ||||
|         if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) { | ||||
|             MyToast.show("再按一次退出"); | ||||
|             lastClickTime = curClickTime; | ||||
|         } else { | ||||
|             BaseApplion.getActivityManage().finishAll(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         outApp(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,75 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.text.TextUtils; | ||||
| import android.view.View; | ||||
| import android.widget.EditText; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.constants.ConstansUserManager; | ||||
| import com.stu.assistant.presenter.RegisterPresenter; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| 
 | ||||
| //账号注册学生,老师信息 数据库中写死的
 | ||||
| public class RegisterActivity extends BaseActivity { | ||||
| 
 | ||||
|     private EditText  userNameEdit, passwordEdit; | ||||
|     private RegisterPresenter presenter; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_register; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, "注册"); | ||||
|         setTextMsg(R.id.btn_register,"注册"); | ||||
|         userNameEdit = findViewById(R.id.tv_username); | ||||
|         passwordEdit = findViewById(R.id.tv_userpassword); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         presenter = new RegisterPresenter(this); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     public void btnRegisterOnClick(View view) { | ||||
|         String userName = userNameEdit.getText().toString(); | ||||
|         String password = passwordEdit.getText().toString(); | ||||
| 
 | ||||
| 
 | ||||
|         if (TextUtils.isEmpty(userName)) { | ||||
|             MyToast.show(userNameEdit.getHint().toString()); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         if (TextUtils.isEmpty(password)) { | ||||
|             MyToast.show(passwordEdit.getHint().toString()); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         UserInfoBean userBean = new UserInfoBean(); | ||||
|         userBean.setUsername(userName); | ||||
|         userBean.setPassword(password); | ||||
|         userBean.setUserLevel(ConstansUserManager.Level_4); | ||||
|         userBean.setUserType(ConstansUserManager.UserType_2); | ||||
|         presenter.registerUser(userBean, new RegisterPresenter.OnRegisterListener() { | ||||
|             @Override | ||||
|             public void registerListener(UserInfoBean userInfoBean) { | ||||
|                 Intent intent = new Intent(); | ||||
|                 intent.putExtra("userBean", userBean); | ||||
|                 setResult(2, intent); | ||||
|                 finish(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,95 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.content.res.Resources; | ||||
| import android.view.View; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.dialog.DiaogUtil; | ||||
| import com.stu.assistant.dialog.PopWindowUtils; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import cn.bmob.v3.BmobUser; | ||||
| 
 | ||||
| //设置页面
 | ||||
| public class SettingActivity extends BaseActivity { | ||||
| 
 | ||||
|     private TextView accountTv, titleTv; | ||||
|     private LinearLayout lay, backLay; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_setting; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         accountTv = findViewById(R.id.tv_account); | ||||
|         titleTv = findViewById(R.id.title_tv); | ||||
|         titleTv.setText("设置"); | ||||
|         backLay = findViewById(R.id.back_lay); | ||||
|         lay = findViewById(R.id.lay); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         accountTv.setText("登录账号:" + SharedUtil.create(SettingActivity.this).getString(SharedConfig.loginName)); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         backLay.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 Intent intent = new Intent(SettingActivity.this, MainActivity.class); | ||||
|                 startActivity(intent); | ||||
|                 finish(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public void BtnOutOnClick(View view) { | ||||
|         BaseApplion.getActivityManage().finishAll(); | ||||
|         SharedUtil.create(BaseApplion.application).clear(); | ||||
|         BmobUser.logOut(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         Intent intent = new Intent(SettingActivity.this, MainActivity.class); | ||||
|         startActivity(intent); | ||||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     public void OnColorClick(View view) { | ||||
|         DiaogUtil.showSelectColorDialog(SettingActivity.this, lay, "", new DiaogUtil.OnNickNameLisenter() { | ||||
|             @Override | ||||
|             public void OnOkBtn(String msg, PopWindowUtils popWindow) { | ||||
| 
 | ||||
|                 //自己跳转自己 ,关掉动画 无感处理
 | ||||
|                 Intent mIntent = getIntent(); | ||||
|                 finish(); | ||||
|                 //关掉栈中其他的activity ,但主页的不能关掉
 | ||||
|                 BaseApplion.getActivityManage().finishAct(); | ||||
|                 overridePendingTransition(0, 0); | ||||
|                 startActivity(mIntent); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public void OnBgClick(View view) { | ||||
|         DiaogUtil.showSelectBgDialog(SettingActivity.this, lay, new DiaogUtil.OnNickNameLisenter() { | ||||
|             @Override | ||||
|             public void OnOkBtn(String msg, PopWindowUtils popWindow) { | ||||
|                 Intent intent = new Intent(SettingActivity.this, MainActivity.class); | ||||
|                 startActivity(intent); | ||||
|                 finish(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,144 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.recyclerview.widget.LinearLayoutManager; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; | ||||
| import cn.bmob.v3.BmobQuery; | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.FindListener; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.os.Handler; | ||||
| import android.view.View; | ||||
| import android.widget.Toast; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.adapter.TableAllListAdapter; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.AllTableListBean; | ||||
| import com.stu.assistant.uitls.DividerItemDecorationUtil; | ||||
| import com.stu.assistant.uitls.LogUtils; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| import com.stu.assistant.view.MySwipeRefreshLayout; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| //课程列表
 | ||||
| public class TableListActivity extends BaseActivity { | ||||
|     private RecyclerView mrv; | ||||
|     private TableAllListAdapter adapter; | ||||
|     private MySwipeRefreshLayout swip; | ||||
|     private Handler handler; | ||||
|     private String userLevel, title; | ||||
|     private int itemType; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_table_list; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         swip = findViewById(R.id.swip_rf); | ||||
|         mrv = findViewById(R.id.mrv); | ||||
|         handler = new Handler(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         LinearLayoutManager manager = new LinearLayoutManager(this); | ||||
|         manager.setOrientation(LinearLayoutManager.VERTICAL); | ||||
|         mrv.addItemDecoration(new DividerItemDecorationUtil(this, false)); | ||||
|         mrv.setLayoutManager(manager); | ||||
|         Intent intent = getIntent(); | ||||
|         userLevel = intent.getStringExtra("userLevel"); | ||||
|         title = intent.getStringExtra("title"); | ||||
|         itemType = intent.getIntExtra("itemType", 0); | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, title); | ||||
|         setTextMsg(R.id.btn_register, "添加" + title); | ||||
|         getData(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         // 刷新数据
 | ||||
|         swip.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | ||||
|             @Override | ||||
|             public void onRefresh() { | ||||
|                 // 这里的作用是防止下拉刷新的时候还可以上拉加载
 | ||||
|                 getData(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     private void getData() { | ||||
|         showProDialog("正在查询"); | ||||
|         BmobQuery<AllTableListBean> query = new BmobQuery<>(); | ||||
|         query.addWhereEqualTo("stuId", SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|         query.findObjects(new FindListener<AllTableListBean>() { | ||||
|                     @Override | ||||
|                     public void done(List<AllTableListBean> list, BmobException e) { | ||||
|                         LogUtils.i("list", "-stuId-findObjects-->" + new Gson().toJson(list)); | ||||
|                         dismissProDialog(); | ||||
|                         setAdapter((ArrayList<AllTableListBean>) list); | ||||
|                     } | ||||
|                 }); | ||||
|     } | ||||
| 
 | ||||
|     public void setAdapter(ArrayList<AllTableListBean> mList) { | ||||
|         if (mList == null) { | ||||
|             mList = new ArrayList<>(); | ||||
|         } | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, title + "(" + mList.size() + ")"); | ||||
|         if (adapter == null) { | ||||
|             adapter = new TableAllListAdapter(this, mList); | ||||
|             mrv.setAdapter(adapter); | ||||
|             adapter.setOnItemClickListeners(new TableAllListAdapter.OnItemClickListeners() { | ||||
|                 @Override | ||||
|                 public void itemBean(int pos, AllTableListBean tableListBean) { | ||||
|                     Intent intent = new Intent(TableListActivity.this, AddTableActivity.class); | ||||
|                     intent.putExtra("bean",tableListBean); | ||||
|                     startActivityForResult(intent, 201); | ||||
|                 } | ||||
|             }); | ||||
|         } else { | ||||
|             adapter.setList(mList); | ||||
|             adapter.notifyDataSetChanged(); | ||||
| 
 | ||||
|             handler.postDelayed(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     swip.setRefreshing(false); | ||||
|                 } | ||||
|             }, 1000); | ||||
|             if (mList.size() == 0) { | ||||
|                 Toast.makeText(this, "暂无数据", Toast.LENGTH_SHORT).show(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         super.onBackPressed(); | ||||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     public void BtnAddOnClick(View view) { | ||||
|         Intent intent = new Intent(TableListActivity.this, AddTableActivity.class); | ||||
|         startActivityForResult(intent, 201); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | ||||
|         super.onActivityResult(requestCode, resultCode, data); | ||||
|         if (requestCode == 201) { | ||||
|             if (resultCode == 12) { | ||||
|                 getData(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,144 @@ | ||||
| package com.stu.assistant.activity; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.os.Handler; | ||||
| import android.view.View; | ||||
| import android.widget.Toast; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.adapter.TaskAllListAdapter; | ||||
| import com.stu.assistant.base.BaseActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.TaskBean; | ||||
| import com.stu.assistant.uitls.DividerItemDecorationUtil; | ||||
| import com.stu.assistant.uitls.LogUtils; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| import com.stu.assistant.view.MySwipeRefreshLayout; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.recyclerview.widget.LinearLayoutManager; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; | ||||
| import cn.bmob.v3.BmobQuery; | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.FindListener; | ||||
| //作业列表
 | ||||
| public class TaskListActivity extends BaseActivity { | ||||
|     private RecyclerView mrv; | ||||
|     private TaskAllListAdapter adapter; | ||||
|     private MySwipeRefreshLayout swip; | ||||
|     private Handler handler; | ||||
|     private String userLevel, title; | ||||
|     private int itemType; | ||||
| 
 | ||||
|     @Override | ||||
|     protected int getLayoutId() { | ||||
|         return R.layout.activity_table_list; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initView() { | ||||
|         swip = findViewById(R.id.swip_rf); | ||||
|         mrv = findViewById(R.id.mrv); | ||||
|         handler = new Handler(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initData() { | ||||
|         LinearLayoutManager manager = new LinearLayoutManager(this); | ||||
|         manager.setOrientation(LinearLayoutManager.VERTICAL); | ||||
|         mrv.addItemDecoration(new DividerItemDecorationUtil(this, false)); | ||||
|         mrv.setLayoutManager(manager); | ||||
|         Intent intent = getIntent(); | ||||
|         userLevel = intent.getStringExtra("userLevel"); | ||||
|         title = intent.getStringExtra("title"); | ||||
|         itemType = intent.getIntExtra("itemType", 0); | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, title); | ||||
|         setTextMsg(R.id.btn_register, "添加" + title); | ||||
|         getData(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void initListener() { | ||||
|         // 刷新数据
 | ||||
|         swip.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { | ||||
|             @Override | ||||
|             public void onRefresh() { | ||||
|                 // 这里的作用是防止下拉刷新的时候还可以上拉加载
 | ||||
|                 getData(); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     private void getData() { | ||||
|         showProDialog("正在查询"); | ||||
|         BmobQuery<TaskBean> query = new BmobQuery<>(); | ||||
|         query.addWhereEqualTo("stuId", SharedUtil.create(BaseApplion.application).getString(SharedConfig.objectId)); | ||||
|         query.findObjects(new FindListener<TaskBean>() { | ||||
|                     @Override | ||||
|                     public void done(List<TaskBean> list, BmobException e) { | ||||
|                         LogUtils.i("list", "-stuId-findObjects-->" + new Gson().toJson(list)); | ||||
|                         dismissProDialog(); | ||||
|                         setAdapter((ArrayList<TaskBean>) list); | ||||
|                     } | ||||
|                 }); | ||||
|     } | ||||
| 
 | ||||
|     public void setAdapter(ArrayList<TaskBean> mList) { | ||||
|         if (mList == null) { | ||||
|             mList = new ArrayList<>(); | ||||
|         } | ||||
|         setTitleLay(R.id.title_tv, R.id.back_lay, title + "(" + mList.size() + ")"); | ||||
|         if (adapter == null) { | ||||
|             adapter = new TaskAllListAdapter(this, mList); | ||||
|             mrv.setAdapter(adapter); | ||||
|             adapter.setOnItemClickListeners(new TaskAllListAdapter.OnItemClickListeners() { | ||||
|                 @Override | ||||
|                 public void itemBean(int pos, TaskBean tableListBean) { | ||||
|                     Intent intent = new Intent(TaskListActivity.this, AddTaskActivity.class); | ||||
|                     intent.putExtra("bean",tableListBean); | ||||
|                     startActivityForResult(intent, 201); | ||||
|                 } | ||||
|             }); | ||||
|         } else { | ||||
|             adapter.setList(mList); | ||||
|             adapter.notifyDataSetChanged(); | ||||
| 
 | ||||
|             handler.postDelayed(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     swip.setRefreshing(false); | ||||
|                 } | ||||
|             }, 1000); | ||||
|             if (mList.size() == 0) { | ||||
|                 Toast.makeText(this, "暂无数据", Toast.LENGTH_SHORT).show(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBackPressed() { | ||||
|         super.onBackPressed(); | ||||
|         finish(); | ||||
|     } | ||||
| 
 | ||||
|     public void BtnAddOnClick(View view) { | ||||
|         Intent intent = new Intent(TaskListActivity.this, AddTaskActivity.class); | ||||
|         startActivityForResult(intent, 201); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | ||||
|         super.onActivityResult(requestCode, resultCode, data); | ||||
|         if (requestCode == 201) { | ||||
|             if (resultCode == 12) { | ||||
|                 getData(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,67 @@ | ||||
| package com.stu.assistant.adapter; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.BaseAdapter; | ||||
| import android.widget.ImageView; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.MainModuleBean; | ||||
| import com.stu.assistant.uitls.ImageUtil; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| public class HomeGvAdapter extends BaseAdapter { | ||||
| 
 | ||||
|     private Context mContext; | ||||
|     private ViewHolder holder; | ||||
|     private ArrayList<MainModuleBean> list; | ||||
| 
 | ||||
|     public HomeGvAdapter(Context context, ArrayList<MainModuleBean> moduleBeansList) { | ||||
|         mContext = context; | ||||
|         this.list = moduleBeansList; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int getCount() { | ||||
|         return list == null ? 0 : list.size(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Object getItem(int position) { | ||||
|         return list.get(position); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public long getItemId(int position) { | ||||
|         return position; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public View getView(int position, View convertView, ViewGroup parent) { | ||||
|         if (convertView == null) { | ||||
|             convertView = LayoutInflater.from(mContext).inflate(R.layout.item_gridview, parent, false); | ||||
|             holder = new ViewHolder(convertView); | ||||
|             convertView.setTag(holder); | ||||
|         } else { | ||||
|             holder = (ViewHolder) convertView.getTag(); | ||||
|         } | ||||
|         ImageUtil.showImageView(BaseApplion.application,list.get(position).getImageView(), holder.mImageView); | ||||
|         holder.mTextView.setText(list.get(position).getName()); | ||||
|         return convertView; | ||||
|     } | ||||
| 
 | ||||
|     class ViewHolder { | ||||
|         private ImageView mImageView; | ||||
|         private TextView mTextView; | ||||
| 
 | ||||
|         public ViewHolder(View convertView) { | ||||
|             mImageView = (ImageView) convertView.findViewById(R.id.img_into); | ||||
|             mTextView = (TextView) convertView.findViewById(R.id.tv); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,93 @@ | ||||
| package com.stu.assistant.adapter; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.bean.AllTableListBean; | ||||
| import com.stu.assistant.constants.ConstansTableItemManager; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| 
 | ||||
| public class TableAllListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||||
|     ArrayList<AllTableListBean> list1 = new ArrayList<>(); | ||||
|     Context mContext; | ||||
|     private String userLevel; | ||||
|     private int itemType; | ||||
| 
 | ||||
|     public TableAllListAdapter(Context mContext, ArrayList<AllTableListBean> list1) { | ||||
|         this.mContext = mContext; | ||||
|         this.list1 = list1; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public void setList(ArrayList<AllTableListBean> list1) { | ||||
|         this.list1 = list1; | ||||
|     } | ||||
| 
 | ||||
|     @NonNull | ||||
|     @Override | ||||
|     public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||||
|         ItemViewHodler sectionViewHodler = null; | ||||
|         sectionViewHodler = new ItemViewHodler(LayoutInflater.from(mContext).inflate(R.layout.table_all_list_item_layout, parent, false), viewType); | ||||
|         return sectionViewHodler; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { | ||||
|         ItemViewHodler itemViewHodler = (ItemViewHodler) holder; | ||||
|         itemViewHodler.nameTv.setText("课程表" + (position + 1) + "\n创建时间:" + list1.get(position).getCreatedAt()); | ||||
|         setOnItem(itemViewHodler.nameTv, position, list1.get(position)); | ||||
|     } | ||||
| 
 | ||||
|     private void setOnItem(TextView time1Tv, int position, AllTableListBean AllTableListBean) { | ||||
|         time1Tv.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 listeners.itemBean(position, AllTableListBean); | ||||
|             } | ||||
|         }); | ||||
| //        if (position % 2 == 0) {
 | ||||
| //            time1Tv.setBackgroundResource(R.color.mistyrose);
 | ||||
| //        } else {
 | ||||
| //            time1Tv.setBackgroundResource(R.color.light_blue_50);
 | ||||
| //        }
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int getItemCount() { | ||||
|         return list1.size(); | ||||
|     } | ||||
| 
 | ||||
|     public class ItemViewHodler extends RecyclerView.ViewHolder { | ||||
| 
 | ||||
|         public TextView nameTv; | ||||
|         public int viewType; | ||||
| 
 | ||||
|         public ItemViewHodler(@NonNull View itemView, int viewType) { | ||||
|             super(itemView); | ||||
|             this.viewType = viewType; | ||||
|             nameTv = itemView.findViewById(R.id.name_tv); | ||||
|         } | ||||
| 
 | ||||
|         public int getViewType() { | ||||
|             return viewType; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public interface OnItemClickListeners { | ||||
|         void itemBean(int pos, AllTableListBean AllTableListBean); | ||||
|     } | ||||
| 
 | ||||
|     public OnItemClickListeners listeners; | ||||
| 
 | ||||
|     public void setOnItemClickListeners(OnItemClickListeners listener) { | ||||
|         this.listeners = listener; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,127 @@ | ||||
| package com.stu.assistant.adapter; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.ImageView; | ||||
| import android.widget.LinearLayout; | ||||
| import android.widget.RadioGroup; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.bean.TableBean; | ||||
| import com.stu.assistant.constants.ConstansTableItemManager; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| 
 | ||||
| public class TableListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||||
|     ArrayList<TableBean> list1 = new ArrayList<>(); | ||||
|     ArrayList<TableBean> list2 = new ArrayList<>(); | ||||
|     ArrayList<TableBean> list3 = new ArrayList<>(); | ||||
|     ArrayList<TableBean> list4 = new ArrayList<>(); | ||||
|     ArrayList<TableBean> list5 = new ArrayList<>(); | ||||
|     Context mContext; | ||||
|     private String userLevel; | ||||
|     private int itemType; | ||||
| 
 | ||||
|     public TableListAdapter(Context mContext) { | ||||
|         this.mContext = mContext; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public void setList(ArrayList<TableBean> list1, ArrayList<TableBean> list2, ArrayList<TableBean> list3, ArrayList<TableBean> list4, ArrayList<TableBean> list5) { | ||||
|         this.list1 = list1; | ||||
|         this.list2 = list2; | ||||
|         this.list3 = list3; | ||||
|         this.list4 = list4; | ||||
|         this.list5 = list5; | ||||
|     } | ||||
| 
 | ||||
|     @NonNull | ||||
|     @Override | ||||
|     public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||||
|         ItemViewHodler sectionViewHodler = null; | ||||
|         sectionViewHodler = new ItemViewHodler(LayoutInflater.from(mContext).inflate(R.layout.table_item_layout, parent, false), viewType); | ||||
|         return sectionViewHodler; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { | ||||
|         ItemViewHodler itemViewHodler = (ItemViewHodler) holder; | ||||
|         itemViewHodler.time1Tv.setText(list1.get(position).getTableNameMsg() + "[" +list1.get(position).getTeacherName()+","+ list1.get(position).getAddress()+"]"); | ||||
|         itemViewHodler.time2Tv.setText(list2.get(position).getTableNameMsg() + "[" + list2.get(position).getTeacherName()+","+list2.get(position).getAddress()+"]"); | ||||
|         itemViewHodler.time3Tv.setText(list3.get(position).getTableNameMsg() + "[" + list3.get(position).getTeacherName()+","+list3.get(position).getAddress()+"]"); | ||||
|         itemViewHodler.time4Tv.setText(list4.get(position).getTableNameMsg() + "[" + list4.get(position).getTeacherName()+","+list4.get(position).getAddress()+"]"); | ||||
|         itemViewHodler.time5Tv.setText(list5.get(position).getTableNameMsg() + "[" + list5.get(position).getTeacherName()+","+list5.get(position).getAddress()+"]"); | ||||
|         itemViewHodler.timeTv.setText("" + (position + 1)); | ||||
| 
 | ||||
|         itemViewHodler.time1Tv.setText(itemViewHodler.time1Tv.getText().toString().replace("[,]","")); | ||||
|         itemViewHodler.time2Tv.setText(itemViewHodler.time2Tv.getText().toString().replace("[,]","")); | ||||
|         itemViewHodler.time3Tv.setText(itemViewHodler.time3Tv.getText().toString().replace("[,]","")); | ||||
|         itemViewHodler.time4Tv.setText(itemViewHodler.time4Tv.getText().toString().replace("[,]","")); | ||||
|         itemViewHodler.time5Tv.setText(itemViewHodler.time5Tv.getText().toString().replace("[,]","")); | ||||
|         setOnItem(itemViewHodler.time1Tv, position,list1.get(position), ConstansTableItemManager.item_1); | ||||
|         setOnItem(itemViewHodler.time2Tv, position,list2.get(position), ConstansTableItemManager.item_2); | ||||
|         setOnItem(itemViewHodler.time3Tv, position,list3.get(position), ConstansTableItemManager.item_3); | ||||
|         setOnItem(itemViewHodler.time4Tv, position,list4.get(position), ConstansTableItemManager.item_4); | ||||
|         setOnItem(itemViewHodler.time5Tv, position, list5.get(position),ConstansTableItemManager.item_5); | ||||
|         setOnItem(itemViewHodler.timeTv, position,list1.get(position), ConstansTableItemManager.item_99); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     private void setOnItem(TextView time1Tv, int position,TableBean tableBean, int item_1) { | ||||
|         time1Tv.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 if(item_1 != ConstansTableItemManager.item_99){ | ||||
|                     listeners.itemBean(position,tableBean, item_1); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
| //        if (position % 2 == 0) {
 | ||||
| //            time1Tv.setBackgroundResource(R.color.mistyrose);
 | ||||
| //        } else {
 | ||||
| //            time1Tv.setBackgroundResource(R.color.light_blue_50);
 | ||||
| //        }
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int getItemCount() { | ||||
|         return list1.size(); | ||||
|     } | ||||
| 
 | ||||
|     public class ItemViewHodler extends RecyclerView.ViewHolder { | ||||
| 
 | ||||
|         public TextView time1Tv, time2Tv, time3Tv, time4Tv, time5Tv, timeTv; | ||||
|         public int viewType; | ||||
| 
 | ||||
|         public ItemViewHodler(@NonNull View itemView, int viewType) { | ||||
|             super(itemView); | ||||
|             this.viewType = viewType; | ||||
|             time1Tv = itemView.findViewById(R.id.tv_time1); | ||||
|             time2Tv = itemView.findViewById(R.id.tv_time2); | ||||
|             time3Tv = itemView.findViewById(R.id.tv_time3); | ||||
|             time4Tv = itemView.findViewById(R.id.tv_time4); | ||||
|             time5Tv = itemView.findViewById(R.id.tv_time5); | ||||
|             timeTv = itemView.findViewById(R.id.tv_time); | ||||
|         } | ||||
| 
 | ||||
|         public int getViewType() { | ||||
|             return viewType; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public interface OnItemClickListeners { | ||||
|         void itemBean(int pos,TableBean tableBean, int day); | ||||
|     } | ||||
| 
 | ||||
|     public OnItemClickListeners listeners; | ||||
| 
 | ||||
|     public void setOnItemClickListeners(OnItemClickListeners listener) { | ||||
|         this.listeners = listener; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,87 @@ | ||||
| package com.stu.assistant.adapter; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.LayoutInflater; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.bean.TaskBean; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.recyclerview.widget.RecyclerView; | ||||
| 
 | ||||
| public class TaskAllListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | ||||
|     ArrayList<TaskBean> list1 = new ArrayList<>(); | ||||
|     Context mContext; | ||||
|     private String userLevel; | ||||
|     private int itemType; | ||||
| 
 | ||||
|     public TaskAllListAdapter(Context mContext, ArrayList<TaskBean> list1) { | ||||
|         this.mContext = mContext; | ||||
|         this.list1 = list1; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public void setList(ArrayList<TaskBean> list1) { | ||||
|         this.list1 = list1; | ||||
|     } | ||||
| 
 | ||||
|     @NonNull | ||||
|     @Override | ||||
|     public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||||
|         ItemViewHodler sectionViewHodler = null; | ||||
|         sectionViewHodler = new ItemViewHodler(LayoutInflater.from(mContext).inflate(R.layout.table_all_list_item_layout, parent, false), viewType); | ||||
|         return sectionViewHodler; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) { | ||||
|         ItemViewHodler itemViewHodler = (ItemViewHodler) holder; | ||||
|         itemViewHodler.nameTv.setText("课程名称:" + list1.get(position).getTableNameMsg() + "\n截止时间:" + list1.get(position).getTime()); | ||||
|         setOnItem(itemViewHodler.nameTv, position, list1.get(position)); | ||||
|     } | ||||
| 
 | ||||
|     private void setOnItem(TextView time1Tv, int position, TaskBean TaskBean) { | ||||
|         time1Tv.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 listeners.itemBean(position, TaskBean); | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int getItemCount() { | ||||
|         return list1.size(); | ||||
|     } | ||||
| 
 | ||||
|     public class ItemViewHodler extends RecyclerView.ViewHolder { | ||||
| 
 | ||||
|         public TextView nameTv; | ||||
|         public int viewType; | ||||
| 
 | ||||
|         public ItemViewHodler(@NonNull View itemView, int viewType) { | ||||
|             super(itemView); | ||||
|             this.viewType = viewType; | ||||
|             nameTv = itemView.findViewById(R.id.name_tv); | ||||
|         } | ||||
| 
 | ||||
|         public int getViewType() { | ||||
|             return viewType; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public interface OnItemClickListeners { | ||||
|         void itemBean(int pos, TaskBean TaskBean); | ||||
|     } | ||||
| 
 | ||||
|     public OnItemClickListeners listeners; | ||||
| 
 | ||||
|     public void setOnItemClickListeners(OnItemClickListeners listener) { | ||||
|         this.listeners = listener; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,82 @@ | ||||
| package com.stu.assistant.base; | ||||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.util.Log; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.Stack; | ||||
| 
 | ||||
| /** | ||||
|  * @ClassName ActivityManage | ||||
|  * @Description Activity管理 | ||||
|  * @Author kaiguo | ||||
|  * @Date 2020/3/17 11:10 | ||||
|  */ | ||||
| 
 | ||||
| public class ActivityManage { | ||||
| 
 | ||||
|     //保存所有创建的Activity
 | ||||
|     // private ArrayList<Activity> allActivities = new ArrayList<>();
 | ||||
|     private Stack<Activity> allActivities = new Stack<>(); | ||||
| 
 | ||||
|     /** | ||||
|      * 添加Activity到管理器 | ||||
|      * | ||||
|      * @param activity activity | ||||
|      */ | ||||
|     public void addActivity(Activity activity) { | ||||
|         if (activity != null) { | ||||
|             allActivities.add(activity); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 从管理器移除Activity | ||||
|      * | ||||
|      * @param activity activity | ||||
|      */ | ||||
|     public void removeActivity(Activity activity) { | ||||
|         if (activity != null) { | ||||
|             allActivities.remove(activity); | ||||
|             activity.finish(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 关闭所有Activity | ||||
|      */ | ||||
|     public void finishAll() { | ||||
|         for (Activity activity : allActivities) { | ||||
|             activity.finish(); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public void finishAct() { | ||||
|         for (Activity activity : allActivities) { | ||||
|             Log.i("hx","--activity.getLocalClassName()-->"+activity.getLocalClassName()); | ||||
|             if (!"activity.SettingActivity".equals(activity.getLocalClassName())) { | ||||
|                 activity.finish(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 关闭所有Activity | ||||
|      */ | ||||
|     public Activity getCurrentActivity() { | ||||
|         return allActivities.lastElement(); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public ArrayList<Activity> getAllActivities() { | ||||
|         ArrayList<Activity> list = new ArrayList<>(); | ||||
|         if (allActivities.size() > 0) { | ||||
|             for (Activity a : allActivities) { | ||||
|                 list.add(a); | ||||
|             } | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,41 @@ | ||||
| package com.stu.assistant.base; | ||||
| 
 | ||||
| import android.app.Application; | ||||
| 
 | ||||
| import com.stu.assistant.BuildConfig; | ||||
| import com.stu.assistant.net.OkGoConfig; | ||||
| import com.stu.assistant.uitls.CrashHandler; | ||||
| import com.stu.assistant.uitls.CrashHandlerManage; | ||||
| import com.stu.assistant.uitls.ShowClassNameCallBack; | ||||
| import com.tencent.bugly.crashreport.CrashReport; | ||||
| 
 | ||||
| import cn.bmob.v3.Bmob; | ||||
| 
 | ||||
| public class BaseApplion extends Application { | ||||
|     public static BaseApplion application; | ||||
|     public static ActivityManage activityManage; | ||||
| 
 | ||||
|     @Override | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
|         application = this; | ||||
| 
 | ||||
|         OkGoConfig.initOkGo(this); | ||||
|         if (BuildConfig.DEBUG) { | ||||
|             registerActivityLifecycleCallbacks(new ShowClassNameCallBack()); | ||||
|             CrashHandlerManage.getInstance() | ||||
|                     .init(getApplicationContext()); | ||||
|             CrashHandler.getInstance().setDelayTime(1000 * 60 * 1).init(getApplicationContext()); | ||||
|         } | ||||
|         CrashReport.initCrashReport(getApplicationContext(), "6e238eccba", false); | ||||
| 
 | ||||
|         Bmob.initialize(this, "76a343b680dc028081fb0dd8b028a08d"); | ||||
|     } | ||||
| 
 | ||||
|     public static ActivityManage getActivityManage() { | ||||
|         if (activityManage == null) { | ||||
|             activityManage = new ActivityManage(); | ||||
|         } | ||||
|         return activityManage; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| package com.stu.assistant.base; | ||||
| 
 | ||||
| import java.io.Serializable; | ||||
| 
 | ||||
| import cn.bmob.v3.BmobObject; | ||||
| 
 | ||||
| public class BaseBean extends BmobObject implements Serializable { | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package com.stu.assistant.base; | ||||
| 
 | ||||
| 
 | ||||
| import com.stu.assistant.uitls.Config; | ||||
| 
 | ||||
| public abstract class BasePresenter { | ||||
|     private Config config; | ||||
| 
 | ||||
|     public Config getConfig() { | ||||
|         if (config == null) { | ||||
|             config = new Config(); | ||||
|         } | ||||
|         return config; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| import com.stu.assistant.base.BaseBean; | ||||
| 
 | ||||
| public class AllTableListBean extends BaseBean { | ||||
|     private String tableIdMsg;//整个课程表的唯一id
 | ||||
|     private String stuId; | ||||
| 
 | ||||
|     public AllTableListBean() { | ||||
|     } | ||||
| 
 | ||||
|     public String getStuId() { | ||||
|         return stuId; | ||||
|     } | ||||
| 
 | ||||
|     public void setStuId(String stuId) { | ||||
|         this.stuId = stuId; | ||||
|     } | ||||
| 
 | ||||
|     public String getTableIdMsg() { | ||||
|         return tableIdMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableIdMsg(String tableIdMsg) { | ||||
|         this.tableIdMsg = tableIdMsg; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,51 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| /** | ||||
|  * Created by stf on 2018-07-25. | ||||
|  */ | ||||
| 
 | ||||
| public class MainModuleBean { | ||||
|     private String name; | ||||
|     private int imageView; | ||||
|     private int itemFlag; | ||||
|     private String other; | ||||
| 
 | ||||
| 
 | ||||
|     public MainModuleBean(String name, int itemFlag, int imageView) { | ||||
|         this.name = name; | ||||
|         this.imageView = imageView; | ||||
|         this.itemFlag = itemFlag; | ||||
|     } | ||||
| 
 | ||||
|     public String getName() { | ||||
|         return name; | ||||
|     } | ||||
| 
 | ||||
|     public void setName(String name) { | ||||
|         this.name = name; | ||||
|     } | ||||
| 
 | ||||
|     public int getImageView() { | ||||
|         return imageView; | ||||
|     } | ||||
| 
 | ||||
|     public void setImageView(int imageView) { | ||||
|         this.imageView = imageView; | ||||
|     } | ||||
| 
 | ||||
|     public int getItemFlag() { | ||||
|         return itemFlag; | ||||
|     } | ||||
| 
 | ||||
|     public void setItemFlag(int itemFlag) { | ||||
|         this.itemFlag = itemFlag; | ||||
|     } | ||||
| 
 | ||||
|     public String getOther() { | ||||
|         return other; | ||||
|     } | ||||
| 
 | ||||
|     public void setOther(String other) { | ||||
|         this.other = other; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,92 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| import com.stu.assistant.base.BaseBean; | ||||
| 
 | ||||
| public class TableBean extends BaseBean { | ||||
|     private String tableNameMsg; | ||||
|     private String teacherName; | ||||
|     private String teacherId; | ||||
|     private String stuId; | ||||
|     private String Address; | ||||
|     private int day;//周几
 | ||||
|     private int pos;//第几节
 | ||||
|     private String tableIdMsg;//整个课程表的唯一id
 | ||||
|     private String mark;//注意事项
 | ||||
| 
 | ||||
|     public TableBean() { | ||||
|     } | ||||
| 
 | ||||
|     public String getMark() { | ||||
|         return mark; | ||||
|     } | ||||
| 
 | ||||
|     public void setMark(String mark) { | ||||
|         this.mark = mark; | ||||
|     } | ||||
| 
 | ||||
|     public String getTableIdMsg() { | ||||
|         return tableIdMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableIdMsg(String tableIdMsg) { | ||||
|         this.tableIdMsg = tableIdMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getStuId() { | ||||
|         return stuId; | ||||
|     } | ||||
| 
 | ||||
|     public void setStuId(String stuId) { | ||||
|         this.stuId = stuId; | ||||
|     } | ||||
| 
 | ||||
|     public String getTeacherId() { | ||||
|         return teacherId; | ||||
|     } | ||||
| 
 | ||||
|     public void setTeacherId(String teacherId) { | ||||
|         this.teacherId = teacherId; | ||||
|     } | ||||
| 
 | ||||
|     public int getPos() { | ||||
|         return pos; | ||||
|     } | ||||
| 
 | ||||
|     public void setPos(int pos) { | ||||
|         this.pos = pos; | ||||
|     } | ||||
| 
 | ||||
|     public int getDay() { | ||||
|         return day; | ||||
|     } | ||||
| 
 | ||||
|     public void setDay(int day) { | ||||
|         this.day = day; | ||||
|     } | ||||
| 
 | ||||
|     public String getTableNameMsg() { | ||||
|         return tableNameMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableNameMsg(String tableNameMsg) { | ||||
|         this.tableNameMsg = tableNameMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getTeacherName() { | ||||
|         return teacherName; | ||||
|     } | ||||
| 
 | ||||
|     public void setTeacherName(String teacherName) { | ||||
|         this.teacherName = teacherName; | ||||
|     } | ||||
| 
 | ||||
|     public String getAddress() { | ||||
|         return Address; | ||||
|     } | ||||
| 
 | ||||
|     public void setAddress(String address) { | ||||
|         Address = address; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,60 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| import com.stu.assistant.base.BaseBean; | ||||
| 
 | ||||
| public class TableTimeBean extends BaseBean { | ||||
|     private String time;//具体的某一天
 | ||||
|     private String day;//周几
 | ||||
|     private int tableMsg;//第几节
 | ||||
|     private String mark; | ||||
|     private String teacherId; | ||||
|     private String teacherName; | ||||
| 
 | ||||
|     public int getTableMsg() { | ||||
|         return tableMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableMsg(int tableMsg) { | ||||
|         this.tableMsg = tableMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getTime() { | ||||
|         return time; | ||||
|     } | ||||
| 
 | ||||
|     public void setTime(String time) { | ||||
|         this.time = time; | ||||
|     } | ||||
| 
 | ||||
|     public String getDay() { | ||||
|         return day; | ||||
|     } | ||||
| 
 | ||||
|     public void setDay(String day) { | ||||
|         this.day = day; | ||||
|     } | ||||
| 
 | ||||
|     public String getMark() { | ||||
|         return mark; | ||||
|     } | ||||
| 
 | ||||
|     public void setMark(String mark) { | ||||
|         this.mark = mark; | ||||
|     } | ||||
| 
 | ||||
|     public String getTeacherId() { | ||||
|         return teacherId; | ||||
|     } | ||||
| 
 | ||||
|     public void setTeacherId(String teacherId) { | ||||
|         this.teacherId = teacherId; | ||||
|     } | ||||
| 
 | ||||
|     public String getTeacherName() { | ||||
|         return teacherName; | ||||
|     } | ||||
| 
 | ||||
|     public void setTeacherName(String teacherName) { | ||||
|         this.teacherName = teacherName; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,54 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| import com.stu.assistant.base.BaseBean; | ||||
| 
 | ||||
| public class TaskBean extends BaseBean { | ||||
|     private String tableNameMsg;//课程名称
 | ||||
|     private String tableIdMsg;//课程名称 id
 | ||||
|     private String taskMsg;//作业内容
 | ||||
|     private String time;//时间
 | ||||
|     private String stuId;//学生
 | ||||
| 
 | ||||
|     public TaskBean() { | ||||
|     } | ||||
| 
 | ||||
|     public String getTableIdMsg() { | ||||
|         return tableIdMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableIdMsg(String tableIdMsg) { | ||||
|         this.tableIdMsg = tableIdMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getTableNameMsg() { | ||||
|         return tableNameMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTableNameMsg(String tableNameMsg) { | ||||
|         this.tableNameMsg = tableNameMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getTaskMsg() { | ||||
|         return taskMsg; | ||||
|     } | ||||
| 
 | ||||
|     public void setTaskMsg(String taskMsg) { | ||||
|         this.taskMsg = taskMsg; | ||||
|     } | ||||
| 
 | ||||
|     public String getTime() { | ||||
|         return time; | ||||
|     } | ||||
| 
 | ||||
|     public void setTime(String time) { | ||||
|         this.time = time; | ||||
|     } | ||||
| 
 | ||||
|     public String getStuId() { | ||||
|         return stuId; | ||||
|     } | ||||
| 
 | ||||
|     public void setStuId(String stuId) { | ||||
|         this.stuId = stuId; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,76 @@ | ||||
| package com.stu.assistant.bean; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| import cn.bmob.v3.BmobUser; | ||||
| 
 | ||||
| public class UserInfoBean extends BmobUser { | ||||
|     private String nickName; | ||||
|     public String userId; | ||||
|     public String age; | ||||
|     public String address; | ||||
|     public String userLevel;//等级
 | ||||
|     public String userType;//用户角色
 | ||||
|     public String evaluate;//评分
 | ||||
| 
 | ||||
| 
 | ||||
|     public UserInfoBean() { | ||||
|     } | ||||
| 
 | ||||
|     public String getEvaluate() { | ||||
|         return evaluate; | ||||
|     } | ||||
| 
 | ||||
|     public void setEvaluate(String evaluate) { | ||||
|         this.evaluate = evaluate; | ||||
|     } | ||||
| 
 | ||||
|     public String getUserLevel() { | ||||
|         return userLevel; | ||||
|     } | ||||
| 
 | ||||
|     public void setUserLevel(String userLevel) { | ||||
|         this.userLevel = userLevel; | ||||
|     } | ||||
| 
 | ||||
|     public String getUserType() { | ||||
|         return userType; | ||||
|     } | ||||
| 
 | ||||
|     public void setUserType(String userType) { | ||||
|         this.userType = userType; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public String getNickName() { | ||||
|         return nickName; | ||||
|     } | ||||
| 
 | ||||
|     public void setNickName(String nickName) { | ||||
|         this.nickName = nickName; | ||||
|     } | ||||
| 
 | ||||
|     public String getUserId() { | ||||
|         return userId; | ||||
|     } | ||||
| 
 | ||||
|     public void setUserId(String userId) { | ||||
|         this.userId = userId; | ||||
|     } | ||||
| 
 | ||||
|     public String getAge() { | ||||
|         return age; | ||||
|     } | ||||
| 
 | ||||
|     public void setAge(String age) { | ||||
|         this.age = age; | ||||
|     } | ||||
| 
 | ||||
|     public String getAddress() { | ||||
|         return address; | ||||
|     } | ||||
| 
 | ||||
|     public void setAddress(String address) { | ||||
|         this.address = address; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,7 @@ | ||||
| package com.stu.assistant.constants; | ||||
| 
 | ||||
| public class ConstansItemManager { | ||||
|     public static final int item_1 = 1; //课表
 | ||||
|     public static final int item_2 = 2; //作业
 | ||||
|     public static final int item_3 = 3; //设置
 | ||||
| } | ||||
| @ -0,0 +1,13 @@ | ||||
| package com.stu.assistant.constants; | ||||
| 
 | ||||
| public class ConstansTableItemManager { | ||||
|     public static final int item_1 = 1; | ||||
|     public static final int item_2 = 2; | ||||
|     public static final int item_3 = 3; | ||||
|     public static final int item_4 = 4; | ||||
|     public static final int item_5 = 5; | ||||
|     public static final int item_6 = 6; | ||||
|     public static final int item_7 = 7; | ||||
|     public static final int item_99 = 99; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,10 @@ | ||||
| package com.stu.assistant.constants; | ||||
| 
 | ||||
| public class ConstansUserManager { | ||||
|     public static final String Level_1 = "10"; //管理员
 | ||||
|     public static final String Level_2 = "20";//部门管理
 | ||||
|     public static final String Level_3 = "30";//学生
 | ||||
|     public static final String Level_4 = "40";//大众用户
 | ||||
|     public static final String UserType_1 = "1";//管理员
 | ||||
|     public static final String UserType_2 = "2";//用户
 | ||||
| } | ||||
| @ -0,0 +1,318 @@ | ||||
| package com.stu.assistant.dialog; | ||||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.text.TextUtils; | ||||
| import android.util.Log; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.EditText; | ||||
| import android.widget.RadioGroup; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| //import com.bigkoo.pickerview.builder.TimePickerBuilder;
 | ||||
| //import com.bigkoo.pickerview.listener.OnTimeSelectListener;
 | ||||
| //import com.bigkoo.pickerview.view.TimePickerView;
 | ||||
| //import com.wwdw.easytimeapplication.R;
 | ||||
| //import com.wwdw.easytimeapplication.contants.AddMoneyBeanType;
 | ||||
| //import com.wwdw.easytimeapplication.uitls.AppTools;
 | ||||
| //import com.wwdw.easytimeapplication.uitls.CalendarUtil;
 | ||||
| //import com.wwdw.easytimeapplication.uitls.MyToast;
 | ||||
| //import com.wwdw.easytimeapplication.uitls.ScriptEngineUtils;
 | ||||
| 
 | ||||
| import com.bigkoo.pickerview.builder.TimePickerBuilder; | ||||
| import com.bigkoo.pickerview.listener.OnTimeSelectListener; | ||||
| import com.bigkoo.pickerview.view.TimePickerView; | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.uitls.AppTools; | ||||
| import com.stu.assistant.uitls.CalendarUtil; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedNoClearUtil; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.Calendar; | ||||
| import java.util.Date; | ||||
| 
 | ||||
| public class DiaogUtil { | ||||
|     private PopWindowUtils popWindowUtils; | ||||
| 
 | ||||
|     public static void showInputDialog(final Activity activity, View parent_view, final String title, final OnShowInputLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, PopWindowUtils popWindow) { | ||||
| 
 | ||||
|             } | ||||
|         }).setConView(R.layout.input_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public static void showDelDialog(Activity activity, View parent_view, final String msg, final OnNickNameLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, final PopWindowUtils popWindow) { | ||||
|                 TextView canTv = contentView.findViewById(R.id.tv_can); | ||||
|                 TextView okTv = contentView.findViewById(R.id.tv_ok); | ||||
|                 final TextView editText = contentView.findViewById(R.id.mark_edit); | ||||
|                 if (!TextUtils.isEmpty(msg)) { | ||||
|                     editText.setText("确定要删除" + msg + "吗?"); | ||||
|                 } | ||||
|                 canTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|                 okTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                         lisenter.OnOkBtn(msg, popWindow); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }).setConView(R.layout.select_color_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
| 
 | ||||
|     public static void showOutAppDialog(Activity activity, View parent_view, final String msg, final OnNickNameLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, final PopWindowUtils popWindow) { | ||||
|                 TextView canTv = contentView.findViewById(R.id.tv_can); | ||||
|                 TextView okTv = contentView.findViewById(R.id.tv_ok); | ||||
|                 final TextView editText = contentView.findViewById(R.id.mark_edit); | ||||
|                 editText.setText("确定退出?"); | ||||
|                 canTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|                 okTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                         lisenter.OnOkBtn(msg, popWindow); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }).setConView(R.layout.select_color_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
| 
 | ||||
|     public static void showSelectColorDialog(Activity activity, View parent_view, final String msg, final OnNickNameLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, final PopWindowUtils popWindow) { | ||||
|                 TextView canTv = contentView.findViewById(R.id.tv_can); | ||||
|                 TextView okTv = contentView.findViewById(R.id.tv_ok); | ||||
|                 RadioGroup radioGroup = contentView.findViewById(R.id.rg); | ||||
|                 canTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|                 okTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         int checkedRadioButtonId = radioGroup.getCheckedRadioButtonId(); | ||||
|                         if (checkedRadioButtonId == R.id.rb_1) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isTheme,SharedConfig.isThemeMy); | ||||
|                             lisenter.OnOkBtn(msg, popWindow); | ||||
|                         } | ||||
| 
 | ||||
|                         if (checkedRadioButtonId == R.id.rb_2) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isTheme,SharedConfig.isThemeSys); | ||||
|                             lisenter.OnOkBtn(msg, popWindow); | ||||
|                         } | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }).setConView(R.layout.select_color_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
|     public static void showSelectBgDialog(Activity activity, View parent_view, final OnNickNameLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, final PopWindowUtils popWindow) { | ||||
|                 TextView canTv = contentView.findViewById(R.id.tv_can); | ||||
|                 TextView okTv = contentView.findViewById(R.id.tv_ok); | ||||
|                 RadioGroup radioGroup = contentView.findViewById(R.id.rg); | ||||
|                 canTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|                 okTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         int checkedRadioButtonId = radioGroup.getCheckedRadioButtonId(); | ||||
|                         if (checkedRadioButtonId == R.id.rb_1) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isBg,SharedConfig.isBg_1); | ||||
|                         } | ||||
| 
 | ||||
|                         if (checkedRadioButtonId == R.id.rb_2) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isBg,SharedConfig.isBg_2); | ||||
|                         } | ||||
|                         if (checkedRadioButtonId == R.id.rb_3) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isBg,SharedConfig.isBg_3); | ||||
|                         } | ||||
|                         if (checkedRadioButtonId == R.id.rb_4) { | ||||
|                             SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.isBg,SharedConfig.isBg_4); | ||||
|                         } | ||||
|                         lisenter.OnOkBtn("", popWindow); | ||||
|                         popWindow.dismiss(); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }).setConView(R.layout.select_bg_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
| 
 | ||||
|     public static void showTipDialog(Activity activity, View parent_view, final String msg, final OnNickNameLisenter lisenter) { | ||||
|         final PopWindowUtils popWindowUtils = new PopWindowUtils(activity); | ||||
|         popWindowUtils.setFocusables(true); | ||||
|         popWindowUtils.setEditDissmiss(false); | ||||
| //        popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity));
 | ||||
|         popWindowUtils.setWidthSize(AppTools.getScreenWidth(activity) - AppTools.dip2px(activity, 20)); | ||||
|         popWindowUtils.setOnViewClickListener(new PopWindowUtils.ContentView() { | ||||
|             @Override | ||||
|             public void getContentView(View contentView, final PopWindowUtils popWindow) { | ||||
|                 TextView canTv = contentView.findViewById(R.id.tv_can); | ||||
|                 TextView okTv = contentView.findViewById(R.id.tv_ok); | ||||
|                 final EditText editText = contentView.findViewById(R.id.mark_edit); | ||||
|                 okTv.setOnClickListener(new View.OnClickListener() { | ||||
|                     @Override | ||||
|                     public void onClick(View view) { | ||||
|                         String ymd = new CalendarUtil().getYMD3(); | ||||
|                         Log.i("hx", "--ymd-->" + ymd); | ||||
|                         int num = Integer.parseInt(ymd.substring(ymd.length() - 1, ymd.length())) + 3; | ||||
|                         Log.i("hx", "--num-->" + num); | ||||
|                         String pwd = ymd + ymd.substring(ymd.length() - 2, ymd.length()) + num; | ||||
|                         Log.i("hx", "--pwd-->" + pwd); | ||||
| 
 | ||||
|                         String msgNew = editText.getText().toString(); | ||||
|                         if (TextUtils.isEmpty(msgNew)) { | ||||
|                             MyToast.show("请输入密码"); | ||||
|                             return; | ||||
|                         } | ||||
|                         String uidFromBase64 = AppTools.getUidFromBase64(msgNew); | ||||
|                         Log.i("hx", "--msgNew--->" + msgNew + "-uidFromBase64-->" + uidFromBase64); | ||||
|                         if (uidFromBase64.equals(pwd) || uidFromBase64.equals("10001")) { | ||||
|                             popWindowUtils.setEditDissmiss(true); | ||||
|                             if (uidFromBase64.equals("10001")) { | ||||
|                                 String addDay = new CalendarUtil().setAddDay(new Date(), 365 * 10); | ||||
|                                 SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.initTime, addDay); | ||||
|                             } else { | ||||
|                                 String addDay = new CalendarUtil().setAddDay(new Date(), 3); | ||||
|                                 SharedNoClearUtil.create(BaseApplion.application).putString(SharedConfig.initTime, addDay); | ||||
|                             } | ||||
|                             popWindow.dismiss(); | ||||
|                             lisenter.OnOkBtn(msgNew, popWindow); | ||||
|                         } else { | ||||
|                             MyToast.show("密码错误"); | ||||
|                         } | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|         }).setConView(R.layout.tip_dialog_layout).showInCenter(parent_view); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public static void showSelectTimeDialog(Activity activity, final OnSelectLisenter lisenter) { | ||||
|         Calendar selectedDate = Calendar.getInstance(); | ||||
|         CalendarUtil instance = CalendarUtil.getInstance(); | ||||
|         Date date1 = instance.strToDate2(instance.getYMDHM()); | ||||
|         Date date = instance.setAddYear2(date1, 10); | ||||
|         Calendar instance1 = Calendar.getInstance(); | ||||
|         instance1.setTime(date); | ||||
|         selectedDate.setTime(date1); | ||||
|         final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | ||||
|         boolean[] booleans = {true, true, true, true, true, false}; | ||||
|         TimePickerView pvTime = new TimePickerBuilder(activity, new OnTimeSelectListener() { | ||||
|             @Override | ||||
|             public void onTimeSelect(Date date, View v1) { | ||||
|                 String time = dateFormat.format(date); | ||||
|                 lisenter.OnOkBtn(time); | ||||
|             } | ||||
|         }).setDecorView((ViewGroup) activity.getWindow().getDecorView().findViewById(android.R.id.content)) | ||||
|                 .setSubmitColor(R.color.app_yellow) | ||||
|                 .setCancelColor(R.color.app_yellow) | ||||
|                 .setDate(selectedDate) | ||||
|                 .setType(booleans) | ||||
|                 .isCyclic(true) | ||||
|                 .build(); | ||||
|         pvTime.show(); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnSelectLisenter { | ||||
|         void OnOkBtn(String time); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private static void clickListener(final TextView callTv, final TextView moneyTv) { | ||||
|         callTv.setOnClickListener(new View.OnClickListener() { | ||||
|             @Override | ||||
|             public void onClick(View view) { | ||||
|                 String moneyMsg = getMoney(moneyTv); | ||||
|                 String s = getNum(callTv); | ||||
|                 String msg = moneyMsg + s; | ||||
|                 Log.i("stf", "-clickListener-->" + msg + "-s-->" + s + "-moneyMsg-->" + moneyMsg); | ||||
|                 if (!TextUtils.isEmpty(msg)) { | ||||
|                     if ((msg.endsWith("+")) || (msg.endsWith("-"))) { | ||||
|                     } else { | ||||
|                         setMoney(msg, moneyTv); | ||||
|                     } | ||||
|                 } else { | ||||
|                     setMoney(s, moneyTv); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     private static String getMoney(TextView textView) { | ||||
|         return textView.getText().toString().trim().replace(" ", ""); | ||||
|     } | ||||
| 
 | ||||
|     private static String getNum(TextView textView) { | ||||
|         return textView.getText().toString().trim().replace(" ", ""); | ||||
|     } | ||||
| 
 | ||||
|     private static void setMoney(String msg, TextView textView) { | ||||
|         textView.setText(msg); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public interface OnShowInputLisenter { | ||||
|         void OnOkBtn(String moneyMsg, String markMsg, String time); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnNickNameLisenter { | ||||
|         void OnOkBtn(String msg, PopWindowUtils popWindow); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnSelectTypeLisenter { | ||||
|         void OnOkBtn(int type); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,61 @@ | ||||
| package com.stu.assistant.net; | ||||
| 
 | ||||
| /** | ||||
|  * @ClassName Api | ||||
|  * @Description 存储接口地址 | ||||
|  * @Author kaiguo | ||||
|  * @Date 2020/3/17 11:01 | ||||
|  */ | ||||
| public interface Api { | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 登录 | ||||
|      */ | ||||
| 
 | ||||
|     String LOGIN = "user/login"; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|      /** | ||||
|       * @Description: (描述) 根据id获取货架信息 | ||||
|       * @author stf | ||||
|       * @date 2021/11/30 | ||||
|       */ | ||||
| 
 | ||||
|     String getShelvedById = "whManage/getShelvedById"; | ||||
| 
 | ||||
|      | ||||
|     /** | ||||
|      * @Description: (描述) 根据id获取订单明细信息 | ||||
|      * @author stf | ||||
|      * @date 2021/11/30 | ||||
|      */ | ||||
|      | ||||
|     String getDetailById = "inOut/getDetailById"; | ||||
| 
 | ||||
|     /** | ||||
|      * @Description: (描述)批量入库 | ||||
|      * @author stf | ||||
|      * @date 2021/11/30 | ||||
|      */ | ||||
| 
 | ||||
|     String batchWarehousing = "whApp/batchWarehousing"; | ||||
| 
 | ||||
|     /** | ||||
|      * @Description: (描述)批量出库 | ||||
|      * @author stf | ||||
|      * @date 2021/11/30 | ||||
|      */ | ||||
| 
 | ||||
|     String batchExWarehouse = "whApp/batchExWarehouse"; | ||||
| 
 | ||||
|     /** | ||||
|      * @Description: (描述)清空货架 | ||||
|      * @author stf | ||||
|      * @date 2021/11/30 | ||||
|      */ | ||||
| 
 | ||||
|     String emptyShelves = "whApp/emptyShelves"; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,46 @@ | ||||
| package com.stu.assistant.net; | ||||
| 
 | ||||
| public class NetConfig { | ||||
|     /** | ||||
|      * 请求授权码 | ||||
|      */ | ||||
|     public static final String SERVER_URL = "http://47.102.116.226/api/"; | ||||
| 
 | ||||
|     /** | ||||
|      * 响应的返回key | ||||
|      */ | ||||
|     public class Code { | ||||
|         public static final String SUCCESS = "success"; | ||||
|         public static final String MSG = "errorMsg"; | ||||
|         public static final String CODE = "errorCode"; | ||||
|         public static final String MODEL = "data"; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 网络请求Url | ||||
|      */ | ||||
|     public static class Url { | ||||
| 
 | ||||
|         //服务器地址
 | ||||
|         interface BaseUrl { | ||||
|             /** | ||||
|              * 新昌环境 | ||||
|              */ | ||||
|             String SERVER_PRODUCTION = "http://47.102.116.226:28890/wh/"; | ||||
|         } | ||||
| 
 | ||||
|         /** | ||||
|          * 返回服务器基础地址 | ||||
|          */ | ||||
|         public static String getBaseUrl(String url) { | ||||
|             return BaseUrl.SERVER_PRODUCTION + url; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public static final String NetError = "暂无网络连接"; | ||||
|     public static final String ConnectError = "服务器连接失败"; | ||||
|     public static final String DataError = "数据返回异常"; | ||||
|     public static final int Success = 200; | ||||
|     public static final int OutApp = 401; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,11 @@ | ||||
| package com.stu.assistant.net.imp; | ||||
| 
 | ||||
| import com.lzy.okgo.model.Response; | ||||
| 
 | ||||
| public interface OnModleResultListener<T> { | ||||
|     void onSuccess(T bean); | ||||
| 
 | ||||
|     void onError(String e); | ||||
| 
 | ||||
|     void onConnectFail(String msg, Response<String> response); | ||||
| } | ||||
| @ -0,0 +1,77 @@ | ||||
| package com.stu.assistant.presenter; | ||||
| 
 | ||||
| import android.text.TextUtils; | ||||
| 
 | ||||
| import com.google.gson.Gson; | ||||
| import com.stu.assistant.activity.LoginActivity; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.base.BasePresenter; | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.uitls.LogUtils; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import cn.bmob.v3.BmobUser; | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| 
 | ||||
| public class LoginPresenter extends BasePresenter { | ||||
|     private LoginActivity activity; | ||||
| 
 | ||||
|     public LoginPresenter(LoginActivity mAct) { | ||||
|         this.activity = mAct; | ||||
|     } | ||||
| 
 | ||||
|     public void saveUser(UserInfoBean bean) { | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.loginName, bean.getUsername()); | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.nickName, bean.getNickName()); | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.whToken, bean.getSessionToken()); | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.objectId, bean.getObjectId()); | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.userLevel, bean.getUserLevel()); | ||||
|         SharedUtil.create(BaseApplion.application).putString(SharedConfig.userType, bean.getUserType()); | ||||
|         SharedUtil.create(BaseApplion.application).putBoolean(SharedConfig.isLogin, true); | ||||
|     } | ||||
| 
 | ||||
|     public boolean getIsLogin() { | ||||
|         return SharedUtil.create(BaseApplion.application).getBoolean(SharedConfig.isLogin, false); | ||||
|     } | ||||
| 
 | ||||
|     public void loginIn(String usertNameEditMsg, String usertPasswordEditMsg, OnLoginResultListener loginResultListener) { | ||||
|         if (TextUtils.isEmpty(usertNameEditMsg)) { | ||||
|             loginResultListener.errorMsg("请输入账号"); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         if (TextUtils.isEmpty(usertPasswordEditMsg)) { | ||||
|             loginResultListener.errorMsg("请输入密码"); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         activity.showProDialog("正在登录,请稍后..."); | ||||
| 
 | ||||
|         UserInfoBean userInfoBean = new UserInfoBean(); | ||||
|         userInfoBean.setUsername(usertNameEditMsg); | ||||
|         userInfoBean.setPassword(usertPasswordEditMsg); | ||||
|         userInfoBean.login(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean userInfoBean1, BmobException e) { | ||||
|                 activity.dismissProDialog(); | ||||
|                 if (e == null) { | ||||
|                     UserInfoBean user = BmobUser.getCurrentUser(UserInfoBean.class); | ||||
|                     LogUtils.i("hx","-UserInfoBean--->"+new Gson().toJson(user)); | ||||
|                     saveUser(user); | ||||
|                     loginResultListener.isSucLogin(user); | ||||
|                 } else { | ||||
|                     LogUtils.i("hx","-登录失败--->"+e.getMessage()); | ||||
|                     loginResultListener.errorMsg("用户或密码不正确"); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnLoginResultListener { | ||||
|         void isSucLogin(UserInfoBean bean); | ||||
| 
 | ||||
|         void errorMsg(String msg); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package com.stu.assistant.presenter; | ||||
| 
 | ||||
| import com.stu.assistant.R; | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| import com.stu.assistant.bean.MainModuleBean; | ||||
| import com.stu.assistant.constants.ConstansItemManager; | ||||
| import com.stu.assistant.constants.ConstansUserManager; | ||||
| import com.stu.assistant.uitls.SharedConfig; | ||||
| import com.stu.assistant.uitls.SharedUtil; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| 
 | ||||
| public class MainPresenter { | ||||
|     public ArrayList<MainModuleBean> getData() { | ||||
|         ArrayList moduleBeansList = new ArrayList<>(); | ||||
|         moduleBeansList.add(new MainModuleBean("课表", ConstansItemManager.item_1, R.mipmap.ic_timetable)); | ||||
|         moduleBeansList.add(new MainModuleBean("作业", ConstansItemManager.item_2, R.mipmap.ic_task)); | ||||
|         moduleBeansList.add(new MainModuleBean("设置", ConstansItemManager.item_3, R.mipmap.ic_setting)); | ||||
|         return moduleBeansList; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| package com.stu.assistant.presenter; | ||||
| 
 | ||||
| 
 | ||||
| import com.stu.assistant.activity.RegisterActivity; | ||||
| import com.stu.assistant.base.BasePresenter; | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.uitls.MyToast; | ||||
| 
 | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| 
 | ||||
| public class RegisterPresenter extends BasePresenter { | ||||
|     RegisterActivity mActivity; | ||||
| 
 | ||||
|     public RegisterPresenter(RegisterActivity mActivity) { | ||||
|         this.mActivity = mActivity; | ||||
|     } | ||||
| 
 | ||||
|     public void registerUser(UserInfoBean userBean, OnRegisterListener listener) { | ||||
|         mActivity.showProDialog("正在注册...."); | ||||
|         userBean.signUp(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean objectId, BmobException e) { | ||||
|                 mActivity.dismissProDialog(); | ||||
|                 if (e == null) { | ||||
|                     MyToast.show("注册成功"); | ||||
|                     listener.registerListener(userBean); | ||||
|                 } else { | ||||
|                     MyToast.show("注册失败:" + e.getMessage()); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnRegisterListener { | ||||
|         void registerListener(UserInfoBean userInfoBean); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.util.Log; | ||||
| 
 | ||||
| public class BtnClickUtil { | ||||
|     // 两次点击按钮之间的点击间隔不能少于1000毫秒
 | ||||
|     private static final int MIN_CLICK_DELAY_TIME = 1000; | ||||
|     private static long lastClickTime; | ||||
|     public static boolean getIsOk(){ | ||||
|         long curClickTime = System.currentTimeMillis(); | ||||
|         Log.i("stf","-BtnClickUtil--->"+(curClickTime - lastClickTime)); | ||||
|         if((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) { | ||||
|             // 超过点击间隔后再将lastClickTime重置为当前点击时间
 | ||||
|             lastClickTime = curClickTime; | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,48 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.view.KeyEvent; | ||||
| import android.view.View; | ||||
| import android.view.inputmethod.EditorInfo; | ||||
| import android.widget.EditText; | ||||
| import android.widget.TextView; | ||||
| 
 | ||||
| public class CodeConfig { | ||||
|     private static CodeConfig newIns; | ||||
|     private Context mContext; | ||||
| 
 | ||||
|     private CodeConfig(Context context) { | ||||
|         mContext = context; | ||||
|     } | ||||
| 
 | ||||
|     public static CodeConfig newInstance(Context context) { | ||||
|         if (newIns == null) { | ||||
|             synchronized (CodeConfig.class) { | ||||
|                 if (newIns == null) { | ||||
|                     newIns = new CodeConfig(context); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return newIns; | ||||
|     } | ||||
| 
 | ||||
|     public void setEcitTextviewClickListener(final EditText mEditText, final OnEcitTextviewClickListener listener) { | ||||
| 
 | ||||
|         mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { | ||||
|             @Override | ||||
|             public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { | ||||
|                 if (actionId == EditorInfo.IME_ACTION_SEND | ||||
|                         || actionId == EditorInfo.IME_ACTION_DONE | ||||
|                         || (event != null && KeyEvent.KEYCODE_ENTER == event.getKeyCode() && KeyEvent.ACTION_DOWN == event.getAction())) { | ||||
|                     listener.OnEcitTextviewClickListener(v); | ||||
| 
 | ||||
|                 } | ||||
|                 return false; | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     public interface OnEcitTextviewClickListener { | ||||
|         void OnEcitTextviewClickListener(View view); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,256 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.content.pm.ApplicationInfo; | ||||
| import android.content.pm.PackageInfo; | ||||
| import android.content.pm.PackageManager; | ||||
| import android.os.Build; | ||||
| import android.os.Environment; | ||||
| import android.os.Looper; | ||||
| import android.text.TextUtils; | ||||
| import android.util.Log; | ||||
| import android.widget.Toast; | ||||
| 
 | ||||
| import java.io.File; | ||||
| import java.io.FileOutputStream; | ||||
| import java.io.PrintWriter; | ||||
| import java.io.StringWriter; | ||||
| import java.io.Writer; | ||||
| import java.lang.reflect.Field; | ||||
| import java.text.DateFormat; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.Date; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  * Created by stf on 2018-11-05. | ||||
|  */ | ||||
| 
 | ||||
| public class CrashHandler implements Thread.UncaughtExceptionHandler { | ||||
| 
 | ||||
|     public String TAG = "CrashHandler"; | ||||
|     // 系统默认的UncaughtException处理类
 | ||||
|     private Thread.UncaughtExceptionHandler mDefaultHandler; | ||||
|     // CrashHandler实例
 | ||||
|     private static CrashHandler INSTANCE; | ||||
|     // 程序的Context对象
 | ||||
|     private Context mContext; | ||||
|     // 用来存储设备信息和异常信息
 | ||||
|     private Map<String, String> infos = new HashMap<String, String>(); | ||||
|     //显示时间
 | ||||
|     private long time; | ||||
|     //文件夹地址
 | ||||
|     private String pathCrashHandler = "CrashLog"; | ||||
| 
 | ||||
|     /** | ||||
|      * 保证只有一个CrashHandler实例 | ||||
|      */ | ||||
|     private CrashHandler() { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 获取CrashHandler实例 ,单例模式 | ||||
|      */ | ||||
|     public static CrashHandler getInstance() { | ||||
|         if (INSTANCE == null) { | ||||
|             INSTANCE = new CrashHandler(); | ||||
|         } | ||||
|         return INSTANCE; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 初始化 | ||||
|      */ | ||||
| 
 | ||||
|     public CrashHandler setDelayTime(long time) { | ||||
|         this.time = time; | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|     public CrashHandler setTAG(String TAG) { | ||||
|         this.TAG = TAG; | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|     public CrashHandler setPath(String pathCrashHandler) { | ||||
|         this.pathCrashHandler = pathCrashHandler; | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
| //    public CrashHandler setPath() {
 | ||||
| //        this.pathCrashHandler = AppConfig.Path_Crash;
 | ||||
| //        return this;
 | ||||
| //    }
 | ||||
| 
 | ||||
|     public void init(Context context) { | ||||
|         mContext = context; | ||||
|         if (isAppDeBug()) { | ||||
|             Log.i("stf", "-app在-debug->"); | ||||
|             // 获取系统默认的UncaughtException处理器
 | ||||
|             mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler(); | ||||
|             // 设置该CrashHandler为程序的默认处理器
 | ||||
|             Thread.setDefaultUncaughtExceptionHandler(this); | ||||
|         } else { | ||||
|             Log.i("stf", "-app在-realse->"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 当UncaughtException发生时会转入该函数来处理 | ||||
|      */ | ||||
|     @Override | ||||
|     public void uncaughtException(Thread thread, Throwable ex) { | ||||
|         if (!handleException(ex) && mDefaultHandler != null) { | ||||
|             // 如果用户没有处理则让系统默认的异常处理器来处理
 | ||||
|             mDefaultHandler.uncaughtException(thread, ex); | ||||
|         } else { | ||||
|             try { | ||||
|                 Thread.sleep(time); | ||||
|             } catch (InterruptedException e) { | ||||
|                 Log.e(TAG, " error : " + e); | ||||
|             } | ||||
|             // 退出程序
 | ||||
|             android.os.Process.killProcess(android.os.Process.myPid()); | ||||
|             System.exit(1); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成. | ||||
|      * | ||||
|      * @param ex | ||||
|      * @return true:如果处理了该异常信息;否则返回false. | ||||
|      */ | ||||
|     private boolean handleException(Throwable ex) { | ||||
|         if (ex == null) { | ||||
|             return false; | ||||
|         } | ||||
|         ex.printStackTrace(); | ||||
| 
 | ||||
|         // 使用Toast来显示异常信息
 | ||||
|         new Thread() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 Looper.prepare(); | ||||
|                 try { | ||||
|                     Toast.makeText(mContext, "程序出现异常,清理app进程后,可清除此卡顿", Toast.LENGTH_LONG).show(); | ||||
|                 }catch (Exception e){ | ||||
|                     e.fillInStackTrace(); | ||||
|                 } | ||||
|                 Looper.loop(); | ||||
|             } | ||||
|         }.start(); | ||||
|         // 收集设备参数信息
 | ||||
|         collectDeviceInfo(mContext); | ||||
|         // 保存日志文件
 | ||||
|         saveCrashInfo2File(ex); | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 收集设备参数信息 | ||||
|      * | ||||
|      * @param ctx | ||||
|      */ | ||||
|     public void collectDeviceInfo(Context ctx) { | ||||
|         try { | ||||
|             PackageManager pm = ctx.getPackageManager(); | ||||
|             PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), | ||||
|                     PackageManager.GET_ACTIVITIES); | ||||
|             if (pi != null) { | ||||
|                 String versionName = pi.versionName == null ? "null" : pi.versionName; | ||||
|                 String versionCode = pi.versionCode + ""; | ||||
|                 infos.put("versionName", versionName); | ||||
|                 infos.put("versionCode", versionCode); | ||||
|             } | ||||
|         } catch (PackageManager.NameNotFoundException e) { | ||||
|             Log.e(TAG, "an error occured when collect package info" + e); | ||||
|         } | ||||
|         Field[] fields = Build.class.getDeclaredFields(); | ||||
|         for (Field field : fields) { | ||||
|             try { | ||||
|                 field.setAccessible(true); | ||||
|                 infos.put(field.getName(), field.get(null).toString()); | ||||
|                 Log.e(TAG, field.getName() + " : " + field.get(null)); | ||||
|             } catch (Exception e) { | ||||
|                 Log.e(TAG, "an error occured when collect crash info" + e); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 保存错误信息到文件中 | ||||
|      * | ||||
|      * @param ex | ||||
|      * @return 返回文件名称, 便于将文件传送到服务器 | ||||
|      */ | ||||
|     private String saveCrashInfo2File(Throwable ex) { | ||||
|         DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); | ||||
|         StringBuffer sb = new StringBuffer(); | ||||
|         for (Map.Entry<String, String> entry : infos.entrySet()) { | ||||
|             String key = entry.getKey(); | ||||
|             String value = entry.getValue(); | ||||
|             sb.append(key + "=" + value + "\n"); | ||||
|         } | ||||
| 
 | ||||
|         Writer writer = new StringWriter(); | ||||
|         PrintWriter printWriter = new PrintWriter(writer); | ||||
|         ex.printStackTrace(printWriter); | ||||
|         Throwable cause = ex.getCause(); | ||||
|         while (cause != null) { | ||||
|             cause.printStackTrace(printWriter); | ||||
|             cause = cause.getCause(); | ||||
|         } | ||||
|         printWriter.close(); | ||||
|         String result = writer.toString(); | ||||
|         sb.append(result); | ||||
|         try { | ||||
|             long timestamp = System.currentTimeMillis(); | ||||
|             String time = formatter.format(new Date()); | ||||
|             String fileName = "log-" + time + "-" + timestamp + ".log"; | ||||
|             if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { | ||||
|                 String path = Environment.getExternalStorageState() + "/" + pathCrashHandler + "/log"; | ||||
|                 File dir = new File(path); | ||||
|                 if (!dir.exists()) { | ||||
|                     dir.mkdirs(); | ||||
|                 } | ||||
|                 Log.e(TAG, "错误日志记录位置=" + dir.getAbsolutePath()); | ||||
|                 FileOutputStream fos = new FileOutputStream(path + "/" + fileName); | ||||
|                 fos.write(sb.toString().getBytes()); | ||||
|                 fos.close(); | ||||
|             } | ||||
|             return fileName; | ||||
|         } catch (Exception e) { | ||||
|             Log.e(TAG, "an error occured while writing file..." + e); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     // 判断app 是不是 debug模式
 | ||||
|     public boolean isAppDeBug() { | ||||
| 
 | ||||
|         if (mContext == null) { | ||||
|             return false; | ||||
|         } | ||||
|         try { | ||||
|             if (TextUtils.isEmpty(mContext.getPackageName())) { | ||||
|                 return false; | ||||
|             } | ||||
|         } catch (Exception e) { | ||||
|             e.fillInStackTrace(); | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         try { | ||||
|             PackageManager pm = mContext.getPackageManager(); | ||||
|             ApplicationInfo ai = pm.getApplicationInfo(mContext.getPackageName(), 0); | ||||
|             return ai != null && (ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; | ||||
|         } catch (PackageManager.NameNotFoundException e) { | ||||
|             e.printStackTrace(); | ||||
|             return false; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,53 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| 
 | ||||
| import com.yanyusong.y_divideritemdecoration.Y_Divider; | ||||
| import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder; | ||||
| import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration; | ||||
| 
 | ||||
| public class DividerItemDecoration0Util extends Y_DividerItemDecoration { | ||||
|     private boolean isPackage; | ||||
|     private int width, height; | ||||
| 
 | ||||
|     public DividerItemDecoration0Util(Context context, boolean pac) { | ||||
|         super(context); | ||||
|         isPackage = pac; | ||||
|         if (isPackage) { | ||||
|             width = 5; | ||||
|             height = 10; | ||||
|         } else { | ||||
|             width=0; | ||||
|             height = 1; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public Y_Divider getDivider(int itemPosition) { | ||||
|         Y_Divider divider = null; | ||||
|         switch (itemPosition % 2) { | ||||
| 
 | ||||
|             case 0: | ||||
|                 //每一行第一个显示rignt和bottom
 | ||||
|                 divider = new Y_DividerBuilder() | ||||
|                         .setRightSideLine(true, 0x00F6F6F6, width, 0, 0) | ||||
|                         .setBottomSideLine(true, 0x00F6F6F6, height, 0, 0) | ||||
|                         .create(); | ||||
|                 break; | ||||
|             case 1: | ||||
|                 //第二个显示Left和bottom
 | ||||
|                 divider = new Y_DividerBuilder() | ||||
|                         .setLeftSideLine(true, 0x00F6F6F6, width, 0, 0) | ||||
|                         .setBottomSideLine(true, 0x00F6F6F6, height, 0, 0) | ||||
|                         .create(); | ||||
|                 break; | ||||
|             default: | ||||
|                 break; | ||||
|         } | ||||
|         return divider; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,53 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| 
 | ||||
| import com.yanyusong.y_divideritemdecoration.Y_Divider; | ||||
| import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder; | ||||
| import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration; | ||||
| 
 | ||||
| public class DividerItemDecorationUtil extends Y_DividerItemDecoration { | ||||
|     private boolean isPackage; | ||||
|     private int width, height; | ||||
| 
 | ||||
|     public DividerItemDecorationUtil(Context context, boolean pac) { | ||||
|         super(context); | ||||
|         isPackage = pac; | ||||
|         if (isPackage) { | ||||
|             width = 5; | ||||
|             height = 10; | ||||
|         } else { | ||||
|             width=0; | ||||
|             height = 10; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public Y_Divider getDivider(int itemPosition) { | ||||
|         Y_Divider divider = null; | ||||
|         switch (itemPosition % 2) { | ||||
| 
 | ||||
|             case 0: | ||||
|                 //每一行第一个显示rignt和bottom
 | ||||
|                 divider = new Y_DividerBuilder() | ||||
|                         .setRightSideLine(true, 0x00F6F6F6, width, 0, 0) | ||||
|                         .setBottomSideLine(true, 0x00F6F6F6, height, 0, 0) | ||||
|                         .create(); | ||||
|                 break; | ||||
|             case 1: | ||||
|                 //第二个显示Left和bottom
 | ||||
|                 divider = new Y_DividerBuilder() | ||||
|                         .setLeftSideLine(true, 0x00F6F6F6, width, 0, 0) | ||||
|                         .setBottomSideLine(true, 0x00F6F6F6, height, 0, 0) | ||||
|                         .create(); | ||||
|                 break; | ||||
|             default: | ||||
|                 break; | ||||
|         } | ||||
|         return divider; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| @ -0,0 +1,107 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| 
 | ||||
| import android.animation.ObjectAnimator; | ||||
| import android.content.Context; | ||||
| import android.util.AttributeSet; | ||||
| import android.util.Log; | ||||
| import android.view.MotionEvent; | ||||
| import android.view.ViewGroup; | ||||
| import android.view.animation.DecelerateInterpolator; | ||||
| 
 | ||||
| import androidx.appcompat.widget.AppCompatTextView; | ||||
| 
 | ||||
| 
 | ||||
| public class DragTextView extends AppCompatTextView { | ||||
|     private int parentHeight; | ||||
|     protected int parentWidth; | ||||
|     private int lastX; | ||||
|     private int lastY; | ||||
|     private boolean isDrag; | ||||
|     private ViewGroup parent; | ||||
| 
 | ||||
|     public DragTextView(Context context) { | ||||
|         super(context); | ||||
|     } | ||||
| 
 | ||||
|     public DragTextView(Context context, AttributeSet attrs) { | ||||
|         super(context, attrs); | ||||
|     } | ||||
| 
 | ||||
|     public DragTextView(Context context, AttributeSet attrs, int defStyleAttr) { | ||||
|         super(context, attrs, defStyleAttr); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean onTouchEvent(MotionEvent event) { | ||||
|         int rawX = (int) event.getRawX(); | ||||
|         int rawY = (int) event.getRawY(); | ||||
|         switch (event.getAction() & MotionEvent.ACTION_MASK) { | ||||
|             case MotionEvent.ACTION_DOWN: | ||||
|                 this.setAlpha(0.9F); | ||||
|                 this.setPressed(true); | ||||
|                 this.isDrag = false; | ||||
|                 this.getParent().requestDisallowInterceptTouchEvent(true); | ||||
|                 this.lastX = rawX; | ||||
|                 this.lastY = rawY; | ||||
|                 if (this.getParent() != null) { | ||||
|                     this.parent = (ViewGroup) this.getParent(); | ||||
|                     this.parentHeight = this.parent.getHeight(); | ||||
|                     this.parentWidth = this.parent.getWidth(); | ||||
|                 } | ||||
|                 break; | ||||
|             case MotionEvent.ACTION_UP: | ||||
|                 if (!this.isNotDrag()) { | ||||
|                     this.setPressed(false); | ||||
|                     this.moveHide(rawX); | ||||
|                 } | ||||
|                 break; | ||||
|             case MotionEvent.ACTION_MOVE: | ||||
|                 if ((double) this.parentHeight > 0.2D && (double) this.parentWidth > 0.2D) { | ||||
|                     this.isDrag = true; | ||||
|                     this.setAlpha(0.9F); | ||||
|                     int dx = rawX - this.lastX; | ||||
|                     int dy = rawY - this.lastY; | ||||
|                     int distance = (int) Math.sqrt((double) (dx * dx + dy * dy)); | ||||
|                     if (distance < 2) { | ||||
|                         this.isDrag = false; | ||||
|                     } else { | ||||
|                         float x = this.getX() + (float) dx; | ||||
|                         float y = this.getY() + (float) dy; | ||||
|                         x = x < 0.0F ? 0.0F : (x > (float) (this.parentWidth - this.getWidth()) ? (float) (this.parentWidth - this.getWidth()) : x); | ||||
|                         y = this.getY() < 0.0F ? 0.0F : (this.getY() + (float) this.getHeight() > (float) this.parentHeight ? (float) (this.parentHeight - this.getHeight()) : y); | ||||
|                         this.setX(x); | ||||
|                         this.setY(y); | ||||
|                         this.lastX = rawX; | ||||
|                         this.lastY = rawY; | ||||
|                         Log.i("aa", "isDrag=" + this.isDrag + "getX=" + this.getX() + ";getY=" + this.getY() + ";parentWidth=" + this.parentWidth); | ||||
|                     } | ||||
|                 } else { | ||||
|                     this.isDrag = false; | ||||
|                 } | ||||
|         } | ||||
| 
 | ||||
|         return !this.isNotDrag() || super.onTouchEvent(event); | ||||
|     } | ||||
| 
 | ||||
|     private boolean isNotDrag() { | ||||
|         return !this.isDrag && (this.getX() == 0.0F || this.getX() == (float) (this.parentWidth - this.getWidth() - getMarginEnd()) || this.getX() == (float) (this.parentWidth - this.getWidth())); | ||||
|     } | ||||
| 
 | ||||
|     private int getMarginEnd() { | ||||
|         ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) getLayoutParams(); | ||||
|         int endMargin = params.getMarginEnd(); | ||||
|         return endMargin; | ||||
|     } | ||||
| 
 | ||||
|     protected void moveHide(int rawX) { | ||||
|         if (rawX >= this.parentWidth / 2) { | ||||
|             this.animate().setInterpolator(new DecelerateInterpolator()).setDuration(500L).xBy((float) (this.parentWidth - this.getWidth()) - this.getX()).start(); | ||||
|         } else { | ||||
|             ObjectAnimator oa = ObjectAnimator.ofFloat(this, "x", new float[]{this.getX(), 0.0F}); | ||||
|             oa.setInterpolator(new DecelerateInterpolator()); | ||||
|             oa.setDuration(500L); | ||||
|             oa.start(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.widget.Toast; | ||||
| 
 | ||||
| import com.stu.assistant.base.BaseApplion; | ||||
| 
 | ||||
| public class MyToast { | ||||
|     public static void show(Context context,String content){ | ||||
|         Toast.makeText(context, content, Toast.LENGTH_SHORT).show(); | ||||
|     } | ||||
|     public static void show(String content){ | ||||
|         Toast.makeText(BaseApplion.application, content, Toast.LENGTH_SHORT).show(); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,51 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.net.ConnectivityManager; | ||||
| import android.net.NetworkInfo; | ||||
| 
 | ||||
| /** | ||||
|  * @ClassName MoneyUtils | ||||
|  * @Description 网络状态工具类 | ||||
|  * @Author kaiguo | ||||
|  * @Date 2020/3/17 14:57 | ||||
|  */ | ||||
| public class NetworkUtil { | ||||
|     public static boolean isNetWorkAvailable2(Context context) { | ||||
|         ConnectivityManager manager = (ConnectivityManager) context | ||||
|                 .getSystemService(Context.CONNECTIVITY_SERVICE); | ||||
|         if (manager != null) { | ||||
|             NetworkInfo info = manager.getActiveNetworkInfo(); | ||||
|             if (info != null && info.isConnected()) { | ||||
|                 return true; | ||||
|             } else { | ||||
|                 return false; | ||||
|             } | ||||
|         } else { | ||||
|             return false; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 是否有可用网络 | ||||
|      * | ||||
|      * @param context context | ||||
|      * @return | ||||
|      */ | ||||
|     public static boolean isNetworkAvailable(Context context) { | ||||
|         ConnectivityManager connectivity = (ConnectivityManager) context | ||||
|                 .getSystemService(Context.CONNECTIVITY_SERVICE); | ||||
|         if (connectivity != null) { | ||||
|             NetworkInfo[] info = connectivity.getAllNetworkInfo(); | ||||
|             if (info != null) { | ||||
|                 for (int i = 0; i < info.length; i++) { | ||||
|                     if (info[i].getState() == NetworkInfo.State.CONNECTED) { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,98 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.util.Log; | ||||
| 
 | ||||
| import com.stu.assistant.bean.UserInfoBean; | ||||
| import com.stu.assistant.constants.ConstansUserManager; | ||||
| 
 | ||||
| import cn.bmob.v3.exception.BmobException; | ||||
| import cn.bmob.v3.listener.SaveListener; | ||||
| 
 | ||||
| public class SaveUserData { | ||||
|     public void saveData(){ | ||||
|         StringBuilder stringBuilder = new StringBuilder(); | ||||
|         UserInfoBean userInfoBean = new UserInfoBean(); | ||||
|         userInfoBean.setUsername("100"); | ||||
|         userInfoBean.setPassword("123456"); | ||||
|         userInfoBean.setNickName("管理员"); | ||||
|         userInfoBean.setUserLevel(ConstansUserManager.Level_1); | ||||
|         userInfoBean.setUserType(ConstansUserManager.UserType_1); | ||||
|         userInfoBean.setEvaluate(""); | ||||
| 
 | ||||
|         userInfoBean.signUp(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean objectId, BmobException e) { | ||||
|                 stringBuilder.append("添加管理员"); | ||||
|                 if (e == null) { | ||||
|                     stringBuilder.append("objectId:" + objectId); | ||||
|                 } else { | ||||
|                     stringBuilder.append("创建数据失败:" + e.getMessage()); | ||||
|                 } | ||||
|                 stringBuilder.append(","); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
| 
 | ||||
|         UserInfoBean userInfoBean2 = new UserInfoBean(); | ||||
|         userInfoBean2.setUsername("201"); | ||||
|         userInfoBean2.setPassword("123456"); | ||||
|         userInfoBean2.setNickName("部门管理员"); | ||||
|         userInfoBean2.setUserLevel(ConstansUserManager.Level_2); | ||||
|         userInfoBean2.setUserType(ConstansUserManager.UserType_1); | ||||
|         userInfoBean2.setEvaluate(""); | ||||
|         userInfoBean2.signUp(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean objectId, BmobException e) { | ||||
|                 stringBuilder.append("部门管理员"); | ||||
|                 if (e == null) { | ||||
|                     stringBuilder.append("objectId:" + objectId); | ||||
|                 } else { | ||||
|                     stringBuilder.append("创建数据失败:" + e.getMessage()); | ||||
|                 } | ||||
|                 stringBuilder.append(","); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|         UserInfoBean userInfoBean3 = new UserInfoBean(); | ||||
|         userInfoBean3.setUsername(ConstansUserManager.Level_3+"1"); | ||||
|         userInfoBean3.setPassword("123456"); | ||||
|         userInfoBean3.setNickName("学生1"); | ||||
|         userInfoBean3.setUserLevel(ConstansUserManager.Level_3); | ||||
|         userInfoBean3.setUserType(ConstansUserManager.UserType_2); | ||||
|         userInfoBean3.setEvaluate(""); | ||||
|         userInfoBean3.signUp(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean objectId, BmobException e) { | ||||
|                 stringBuilder.append("维修员1"); | ||||
|                 if (e == null) { | ||||
|                     stringBuilder.append("objectId:" + objectId); | ||||
|                 } else { | ||||
|                     stringBuilder.append("创建数据失败:" + e.getMessage()); | ||||
|                 } | ||||
|                 stringBuilder.append(","); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
| 
 | ||||
|         UserInfoBean userInfoBean4 = new UserInfoBean(); | ||||
|         userInfoBean4.setUsername(ConstansUserManager.Level_3 + "2"); | ||||
|         userInfoBean4.setPassword("123456"); | ||||
|         userInfoBean4.setNickName("学生2"); | ||||
|         userInfoBean4.setUserLevel(ConstansUserManager.Level_3); | ||||
|         userInfoBean4.setUserType(ConstansUserManager.UserType_2); | ||||
|         userInfoBean4.setEvaluate(""); | ||||
|         userInfoBean4.signUp(new SaveListener<UserInfoBean>() { | ||||
|             @Override | ||||
|             public void done(UserInfoBean objectId, BmobException e) { | ||||
|                 stringBuilder.append("维修员2"); | ||||
|                 if (e == null) { | ||||
|                     stringBuilder.append("objectId:" + objectId); | ||||
|                 } else { | ||||
|                     stringBuilder.append("创建数据失败:" + e.getMessage()); | ||||
|                 } | ||||
|                 stringBuilder.append(","); | ||||
|             } | ||||
|         }); | ||||
| 
 | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| public class SharedConfig { | ||||
|     //用户信息
 | ||||
|     public static String loginName = "loginName"; | ||||
|     public static String nickName = "nickName"; | ||||
|     public static String whToken = "whToken"; | ||||
|     public static String objectId = "objectId"; | ||||
|     public static String userLevel = "userLevel"; | ||||
|     public static String userType = "userType"; | ||||
|     public static String type = "type"; | ||||
|     public static String isLogin = "isLogin"; | ||||
|     public static String isPda = "isPda"; | ||||
|     public static String isTheme = "isTheme"; | ||||
|     public static String isBg = "isBg"; | ||||
|     public static String isBg_1 = "1"; | ||||
|     public static String isBg_2 = "2"; | ||||
|     public static String isBg_3 = "3"; | ||||
|     public static String isBg_4 = "4"; | ||||
|     public static String isThemeSys = "1"; | ||||
|     public static String isThemeMy = "2"; | ||||
|     public static String initTimeValue = "2021-12-07"; | ||||
|     public static String initTime = "initTime"; | ||||
| } | ||||
| @ -0,0 +1,76 @@ | ||||
| package com.stu.assistant.uitls; | ||||
| 
 | ||||
| import android.app.Activity; | ||||
| import android.app.Application; | ||||
| import android.graphics.Color; | ||||
| import android.os.Bundle; | ||||
| import android.util.Log; | ||||
| import android.view.Gravity; | ||||
| import android.view.View; | ||||
| import android.view.ViewGroup; | ||||
| import android.widget.FrameLayout; | ||||
| 
 | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.annotation.Nullable; | ||||
| 
 | ||||
| 
 | ||||
| public class ShowClassNameCallBack implements Application.ActivityLifecycleCallbacks { | ||||
|     @Override | ||||
|     public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityStarted(@NonNull Activity activity) { | ||||
|         if (activity == null) { | ||||
|             return; | ||||
|         } | ||||
|         if (activity.getWindow() == null) { | ||||
|             return; | ||||
|         } | ||||
|         if (activity.getWindow().getDecorView() == null) { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         String activitySimpleName = activity.getClass().getSimpleName(); | ||||
| 
 | ||||
|         Log.i("clazz",activity.getClass().getName()); | ||||
|         DragTextView textView = new DragTextView(activity); | ||||
|         textView.setText(activitySimpleName); | ||||
|         textView.setTextSize(18f); | ||||
|         textView.setTextColor(Color.parseColor("#FF0000")); | ||||
|         textView.setPadding(0, 50, 0, 0); | ||||
| 
 | ||||
|         textView.setClickable(true); | ||||
|         View decorView= activity.getWindow().getDecorView(); | ||||
|         FrameLayout frameLayout= decorView.findViewById(android.R.id.content); | ||||
|         textView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); | ||||
|         textView.setGravity(Gravity.CENTER); | ||||
|         frameLayout.addView(textView); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityResumed(@NonNull Activity activity) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityPaused(@NonNull Activity activity) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityStopped(@NonNull Activity activity) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void onActivityDestroyed(@NonNull Activity activity) { | ||||
| 
 | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,30 @@ | ||||
| package com.stu.assistant.view; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.util.AttributeSet; | ||||
| import com.stu.assistant.R; | ||||
| import androidx.annotation.NonNull; | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; | ||||
| 
 | ||||
| public class MySwipeRefreshLayout extends SwipeRefreshLayout { | ||||
| 
 | ||||
|     public MySwipeRefreshLayout(@NonNull Context context) { | ||||
|         super(context); | ||||
|         init(); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public MySwipeRefreshLayout(@NonNull Context context, @Nullable AttributeSet attrs) { | ||||
|         super(context, attrs); | ||||
|         init(); | ||||
|     } | ||||
| 
 | ||||
|     private void init() { | ||||
|         setColorSchemeResources( | ||||
|                 R.color.app_yellow, | ||||
|                 R.color.app_yellow, | ||||
|                 R.color.app_yellow, | ||||
|                 R.color.app_yellow); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <set xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <translate | ||||
|         android:duration="200" | ||||
|         android:fromYDelta="100" | ||||
|         android:toYDelta="0" /> | ||||
|     <alpha | ||||
|         android:duration="200" | ||||
|         android:fromAlpha="0.0" | ||||
|         android:toAlpha="1.0" /> | ||||
| 
 | ||||
| </set> | ||||
| @ -0,0 +1,12 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <set xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <translate | ||||
|         android:duration="200" | ||||
|         android:fromYDelta="0" | ||||
|         android:toYDelta="100" /> | ||||
|     <alpha | ||||
|         android:duration="200" | ||||
|         android:fromAlpha="1.0" | ||||
|         android:toAlpha="0.0" /> | ||||
| 
 | ||||
| </set> | ||||
| @ -0,0 +1,30 @@ | ||||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:aapt="http://schemas.android.com/aapt" | ||||
|     android:width="108dp" | ||||
|     android:height="108dp" | ||||
|     android:viewportWidth="108" | ||||
|     android:viewportHeight="108"> | ||||
|     <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||||
|         <aapt:attr name="android:fillColor"> | ||||
|             <gradient | ||||
|                 android:endX="85.84757" | ||||
|                 android:endY="92.4963" | ||||
|                 android:startX="42.9492" | ||||
|                 android:startY="49.59793" | ||||
|                 android:type="linear"> | ||||
|                 <item | ||||
|                     android:color="#44000000" | ||||
|                     android:offset="0.0" /> | ||||
|                 <item | ||||
|                     android:color="#00000000" | ||||
|                     android:offset="1.0" /> | ||||
|             </gradient> | ||||
|         </aapt:attr> | ||||
|     </path> | ||||
|     <path | ||||
|         android:fillColor="#FFFFFF" | ||||
|         android:fillType="nonZero" | ||||
|         android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||||
|         android:strokeWidth="1" | ||||
|         android:strokeColor="#00000000" /> | ||||
| </vector> | ||||
| @ -0,0 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="?attr/colortheme" /> | ||||
|     <corners | ||||
|         android:bottomLeftRadius="10dp" | ||||
|         android:bottomRightRadius="10dp" | ||||
|         android:topLeftRadius="10dp" | ||||
|         android:topRightRadius="10dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,7 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="?attr/colortheme" /> | ||||
|     <corners android:radius="8dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="@color/bg" /> | ||||
|     <corners | ||||
|         android:bottomLeftRadius="10dp" | ||||
|         android:bottomRightRadius="10dp" | ||||
|         android:topLeftRadius="10dp" | ||||
|         android:topRightRadius="10dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <solid android:color="?attr/colortheme" /> | ||||
|     <corners android:radius="4dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:shape="rectangle" | ||||
|     tools:ignore="MissingDefaultResource"> | ||||
| 
 | ||||
|     <solid android:color="@color/white" /> | ||||
| 
 | ||||
|     <corners | ||||
|         android:topLeftRadius="20dp" | ||||
|         android:topRightRadius="20dp" | ||||
|         android:bottomLeftRadius="0dp" | ||||
|         android:bottomRightRadius="0dp" | ||||
|  /> | ||||
| 
 | ||||
| 
 | ||||
| </shape> | ||||
| @ -0,0 +1,10 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
| 
 | ||||
|     <solid android:color="@color/white" /> | ||||
| 
 | ||||
|     <corners android:radius="8dp" /> | ||||
|     <stroke | ||||
|         android:width="1dp" | ||||
|         android:color="?attr/colortheme"/> | ||||
| </shape> | ||||
| @ -0,0 +1,9 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
| 
 | ||||
|     <solid android:color="@color/white" /> | ||||
|     <corners android:radius="4dp" /> | ||||
|     <stroke | ||||
|         android:width="1dp" | ||||
|         android:color="?attr/colortheme"/> | ||||
| </shape> | ||||
| @ -0,0 +1,9 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
| 
 | ||||
|     <solid android:color="@color/white" /> | ||||
|     <corners android:radius="8dp" /> | ||||
|     <stroke | ||||
|         android:width="1dp" | ||||
|         android:color="@color/white"/> | ||||
| </shape> | ||||
| @ -0,0 +1,170 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:width="108dp" | ||||
|     android:height="108dp" | ||||
|     android:viewportWidth="108" | ||||
|     android:viewportHeight="108"> | ||||
|     <path | ||||
|         android:fillColor="#3DDC84" | ||||
|         android:pathData="M0,0h108v108h-108z" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M9,0L9,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,0L19,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M29,0L29,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M39,0L39,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M49,0L49,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M59,0L59,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M69,0L69,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M79,0L79,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M89,0L89,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M99,0L99,108" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,9L108,9" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,19L108,19" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,29L108,29" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,39L108,39" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,49L108,49" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,59L108,59" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,69L108,69" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,79L108,79" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,89L108,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M0,99L108,99" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,29L89,29" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,39L89,39" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,49L89,49" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,59L89,59" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,69L89,69" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M19,79L89,79" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M29,19L29,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M39,19L39,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M49,19L49,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M59,19L59,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M69,19L69,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
|     <path | ||||
|         android:fillColor="#00000000" | ||||
|         android:pathData="M79,19L79,89" | ||||
|         android:strokeWidth="0.8" | ||||
|         android:strokeColor="#33FFFFFF" /> | ||||
| </vector> | ||||
| @ -0,0 +1,6 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||||
|     <item android:color="?attr/colortheme" android:state_checked="true" /> | ||||
|     <!-- not selected --> | ||||
|     <item android:color="@color/black" android:state_checked="false" /> | ||||
| </selector> | ||||
| @ -0,0 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="?attr/colortheme" /> | ||||
|     <corners | ||||
|         android:bottomLeftRadius="10dp" | ||||
|         android:bottomRightRadius="10dp" | ||||
|         android:topLeftRadius="10dp" | ||||
|         android:topRightRadius="10dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,7 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="?attr/colortheme" /> | ||||
|     <corners android:radius="8dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:padding="20dp" | ||||
|     android:shape="rectangle"> | ||||
|     <solid android:color="@color/bg" /> | ||||
|     <corners | ||||
|         android:bottomLeftRadius="10dp" | ||||
|         android:bottomRightRadius="10dp" | ||||
|         android:topLeftRadius="10dp" | ||||
|         android:topRightRadius="10dp" /> | ||||
| </shape> | ||||
| @ -0,0 +1,118 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="@color/white" | ||||
|     android:id="@+id/lay" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.AddTableActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:id="@+id/title_time_view" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="40dp" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/time" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:gravity="center" | ||||
|             android:text="时间" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
| 
 | ||||
|         <View | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@color/white" /> | ||||
|         <TextView | ||||
|             android:id="@+id/time1" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:text="周一" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
| 
 | ||||
|         <View | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@color/white" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/time2" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:text="周二" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
| 
 | ||||
|         <View | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@color/white" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/time3" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:text="周三" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
| 
 | ||||
|         <View | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@color/white" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/time4" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:text="周四" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
| 
 | ||||
|         <View | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@color/white" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/time5" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:text="周五" | ||||
|             android:textColor="@color/color_1e1f20_45" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
|     <View | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="1dp" | ||||
|         android:background="@color/white" /> | ||||
|     <com.stu.assistant.view.MySwipeRefreshLayout | ||||
|         android:id="@+id/swip_rf" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_weight="1"> | ||||
| 
 | ||||
|         <androidx.recyclerview.widget.RecyclerView | ||||
|             android:id="@+id/mrv" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" /> | ||||
|     </com.stu.assistant.view.MySwipeRefreshLayout> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,230 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.AddTableDialogActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="30dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="课程名字" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/edit_table_name" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入课程名字" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="上课地点" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/edit_address" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入上课地点" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="任课老师" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <Spinner | ||||
|             android:id="@+id/edit_teacherName" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@null" | ||||
|             android:entries="@array/teacher" | ||||
|             android:gravity="center|left" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="课程周数" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <Spinner | ||||
|             android:id="@+id/spinner_day" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@null" | ||||
|             android:entries="@array/week" | ||||
|             android:gravity="center|left" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="课程节次" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <Spinner | ||||
|             android:id="@+id/spinner_time" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:background="@null" | ||||
|             android:entries="@array/time" | ||||
|             android:gravity="center" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="注意事项" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/edit_mark" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入注意事项" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/OnPushClick" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="50dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/btn_red_bg_4" | ||||
|         android:gravity="center" | ||||
|         android:text="添加" | ||||
|         android:textColor="@color/white" | ||||
|         android:textSize="16sp" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,120 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.AddTableDialogActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="30dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="课程名字" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/edit_task_name" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入课程名字" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="截止时间" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="?attr/colortheme" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_time" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请选择截止时间" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:minHeight="50dp" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/edit_msg" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="150dp" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="top|left" | ||||
|             android:hint="请输入作业内容" | ||||
|             android:paddingLeft="12dp" | ||||
|             android:paddingTop="10dp" | ||||
|             android:paddingRight="12dp" | ||||
|             android:paddingBottom="12dp" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/OnPushClick" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="50dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/btn_red_bg_4" | ||||
|         android:gravity="center" | ||||
|         android:text="添加" | ||||
|         android:textColor="@color/white" | ||||
|         android:textSize="16sp" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,154 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.LoginActivity"> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="30dp" | ||||
|         android:background="@color/black" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/app_name" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="40dp" | ||||
|         android:text="@string/app_name" | ||||
|         android:textColor="@color/black" | ||||
|         android:textSize="24sp" | ||||
|         android:textStyle="bold" | ||||
|         android:visibility="invisible" /> | ||||
| 
 | ||||
|     <ImageView | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:layout_gravity="center" | ||||
|         android:background="@mipmap/ic_big" /> | ||||
| 
 | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="30dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="账号" | ||||
|             android:visibility="gone" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:visibility="gone" | ||||
|             android:background="@color/colorBlue" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_username" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入账号" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="20dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="密码" | ||||
|             android:visibility="gone" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:visibility="gone" | ||||
|             android:background="@color/colorBlue" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_userpassword" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入密码" | ||||
|             android:password="true" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:gravity="right|center_vertical" | ||||
|         android:onClick="OnRegister" | ||||
|         android:paddingTop="15dp" | ||||
|         android:paddingRight="16dp" | ||||
|         android:paddingBottom="10dp" | ||||
|         android:text="注册账号" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/button_login" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="10dp" | ||||
|         android:layout_marginTop="40dp" | ||||
|         android:layout_marginRight="10dp" | ||||
|         android:layout_marginBottom="30dp" | ||||
|         android:background="@drawable/btn_red_bg_4" | ||||
|         android:gravity="center" | ||||
|         android:text="登录" | ||||
|         android:textColor="@color/white" | ||||
|         android:textSize="16sp" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:gravity="center" | ||||
|         android:text="技术支持" | ||||
|         android:visibility="invisible" | ||||
|         android:textColor="@color/text_color_999999" | ||||
|         android:textSize="12sp" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/version_name" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:gravity="center" | ||||
|         android:text="111111" | ||||
|         android:visibility="invisible" | ||||
|         android:textColor="@color/text_color_999999" | ||||
|         android:textSize="12sp" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_weight="1" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,22 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:id="@+id/lay" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.MainActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <include layout="@layout/include_top_toolbar" android:visibility="gone"/> | ||||
| 
 | ||||
|     <GridView | ||||
|         android:id="@+id/main_gridview" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="match_parent" | ||||
|         android:numColumns="3" | ||||
|         android:paddingTop="10dp" | ||||
|         android:verticalSpacing="10dp" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,219 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:orientation="vertical"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:gravity="center" | ||||
|         android:paddingTop="15dp" | ||||
|         android:paddingRight="16dp" | ||||
|         android:textColor="?attr/colortheme" | ||||
|         android:textSize="17sp" | ||||
|         android:textStyle="bold" | ||||
|         android:visibility="invisible" /> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="60dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal" | ||||
|         android:visibility="gone"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="昵称" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="@color/colorBlue" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_nickname" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入昵称" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="20dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="账号" | ||||
|             android:textSize="16sp" | ||||
|             android:visibility="gone" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="@color/colorBlue" | ||||
|             android:visibility="gone" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_username" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入账号" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="20dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="密码" | ||||
|             android:textSize="16sp" | ||||
|             android:visibility="gone" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="@color/colorBlue" | ||||
|             android:visibility="gone" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_userpassword" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入密码" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="20dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal" | ||||
|         android:visibility="gone"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="年龄" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="@color/colorBlue" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_userAge" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入年龄" | ||||
|             android:inputType="number" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="20dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:orientation="horizontal" | ||||
|         android:visibility="gone"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="80dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:focusable="false" | ||||
|             android:gravity="center" | ||||
|             android:text="地址" | ||||
|             android:textSize="16sp" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:layout_width="1dp" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginTop="6dp" | ||||
|             android:layout_marginBottom="6dp" | ||||
|             android:background="@color/colorBlue" /> | ||||
| 
 | ||||
|         <EditText | ||||
|             android:id="@+id/tv_userAddress" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" | ||||
|             android:layout_marginLeft="10dp" | ||||
|             android:background="@null" | ||||
|             android:gravity="center|left" | ||||
|             android:hint="请输入地址" | ||||
|             android:textSize="14sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/btn_register" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="50dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/btn_red_bg_4" | ||||
|         android:gravity="center" | ||||
|         android:onClick="btnRegisterOnClick" | ||||
|         android:text="注册" | ||||
|         android:textColor="@color/white" | ||||
|         android:textSize="16sp" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,104 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:id="@+id/lay" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="@color/bg" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.SettingActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="12dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_marginRight="12dp" | ||||
|         android:layout_marginBottom="10dp" | ||||
|         android:background="@drawable/corners_org_item_with" | ||||
|         android:gravity="center_vertical" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_account" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingLeft="12dp" | ||||
|             android:text="账号:" | ||||
|             android:textColor="@color/black" | ||||
|             android:textSize="16sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="12dp" | ||||
|         android:layout_marginTop="4dp" | ||||
|         android:layout_marginRight="12dp" | ||||
|         android:layout_marginBottom="10dp" | ||||
|         android:background="@drawable/corners_org_item_with" | ||||
|         android:gravity="center_vertical" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_color" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:drawableRight="@mipmap/ic_right" | ||||
|             android:drawablePadding="16dp" | ||||
|             android:onClick="OnColorClick" | ||||
|             android:paddingLeft="12dp" | ||||
|             android:text="主题色变更" | ||||
|             android:textColor="@color/black" | ||||
|             android:textSize="16sp" /> | ||||
|     </LinearLayout> | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="12dp" | ||||
|         android:layout_marginTop="4dp" | ||||
|         android:layout_marginRight="12dp" | ||||
|         android:layout_marginBottom="10dp" | ||||
|         android:background="@drawable/corners_org_item_with" | ||||
|         android:gravity="center_vertical" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_bg" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:drawableRight="@mipmap/ic_right" | ||||
|             android:drawablePadding="16dp" | ||||
|             android:onClick="OnBgClick" | ||||
|             android:paddingLeft="12dp" | ||||
|             android:text="更改课表壁纸" | ||||
|             android:textColor="@color/black" | ||||
|             android:textSize="16sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_weight="1" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:id="@+id/btn_register" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_marginLeft="20dp" | ||||
|         android:layout_marginTop="50dp" | ||||
|         android:layout_marginRight="20dp" | ||||
|         android:background="@drawable/btn_red_bg_4" | ||||
|         android:gravity="center" | ||||
|         android:onClick="BtnOutOnClick" | ||||
|         android:text="退出" | ||||
|         android:textColor="@color/white" | ||||
|         android:textSize="16sp" /> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" /> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,50 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:background="@color/bg" | ||||
|     android:orientation="vertical" | ||||
|     tools:context=".activity.TableListActivity"> | ||||
| 
 | ||||
|     <include layout="@layout/base_heard_layout" /> | ||||
| 
 | ||||
|     <com.stu.assistant.view.MySwipeRefreshLayout | ||||
|         android:id="@+id/swip_rf" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="0dp" | ||||
|         android:layout_marginTop="10dp" | ||||
|         android:layout_weight="1" | ||||
|         android:paddingLeft="12dp" | ||||
|         android:paddingRight="12dp"> | ||||
| 
 | ||||
|         <androidx.recyclerview.widget.RecyclerView | ||||
|             android:id="@+id/mrv" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="match_parent" /> | ||||
|     </com.stu.assistant.view.MySwipeRefreshLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:background="@color/white" | ||||
|         android:gravity="center" | ||||
|         android:paddingTop="10dp" | ||||
|         android:paddingBottom="10dp"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/btn_register" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="50dp" | ||||
|             android:layout_marginLeft="20dp" | ||||
|             android:layout_marginRight="20dp" | ||||
|             android:background="@drawable/btn_red_bg_4" | ||||
|             android:gravity="center" | ||||
|             android:onClick="BtnAddOnClick" | ||||
|             android:text="添加课表" | ||||
|             android:textColor="@color/white" | ||||
|             android:textSize="16sp" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,10 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="match_parent" | ||||
|     android:fitsSystemWindows="false" | ||||
|     android:orientation="vertical"> | ||||
| 
 | ||||
|     <include layout="@layout/fragment_base" /> | ||||
| 
 | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,74 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:id="@+id/title_lay" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="wrap_content" | ||||
|     android:background="?attr/colortheme" | ||||
|     android:orientation="vertical" | ||||
|     android:paddingLeft="12dp" | ||||
|     android:paddingRight="12dp"> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="40dp" | ||||
|         android:layout_marginTop="30dp" | ||||
|         android:gravity="center"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/back_tv" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:gravity="center|left" | ||||
|             android:text="返回" | ||||
|             android:textColor="@color/white" | ||||
|             android:textSize="18sp" | ||||
|             android:textStyle="bold" | ||||
|             android:visibility="gone" /> | ||||
| 
 | ||||
|         <LinearLayout | ||||
|             android:id="@+id/back_lay" | ||||
|             android:layout_width="60dp" | ||||
|             android:layout_height="60dp" | ||||
|             android:gravity="center|left"> | ||||
| 
 | ||||
|             <ImageView | ||||
|                 android:layout_width="36dp" | ||||
|                 android:layout_height="36dp" | ||||
|                 android:background="@mipmap/ic_back" /> | ||||
|         </LinearLayout> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/title_tv" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_weight="1" | ||||
|             android:gravity="center" | ||||
|             android:textColor="@color/white" | ||||
|             android:textSize="20sp" | ||||
|             android:textStyle="bold" /> | ||||
| 
 | ||||
| 
 | ||||
|         <LinearLayout | ||||
|             android:layout_width="60dp" | ||||
|             android:layout_height="60dp" | ||||
|             android:gravity="center|left"> | ||||
| 
 | ||||
|             <TextView | ||||
|                 android:id="@+id/other_tv" | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:gravity="center|right" | ||||
|                 android:text="其他" | ||||
|                 android:textColor="@color/white" | ||||
|                 android:textSize="18sp" | ||||
|                 android:textStyle="bold" | ||||
|                 android:visibility="invisible" /> | ||||
|         </LinearLayout> | ||||
| 
 | ||||
|         <ImageView | ||||
|             android:id="@+id/other_img" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:visibility="gone" /> | ||||
|     </LinearLayout> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:id="@+id/title_lay" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="wrap_content" | ||||
|     android:background="?attr/colortheme" | ||||
|     android:orientation="vertical" | ||||
|     android:paddingLeft="12dp" | ||||
|     android:paddingRight="12dp"> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="40dp" | ||||
|         android:gravity="center" | ||||
|         android:orientation="horizontal"> | ||||
|     </LinearLayout> | ||||
| </LinearLayout> | ||||
| @ -0,0 +1,53 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="wrap_content" | ||||
|     android:layout_margin="10dp" | ||||
|     android:background="@color/white" | ||||
|     android:orientation="vertical"> | ||||
| 
 | ||||
|     <TextView | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:gravity="center" | ||||
|         android:padding="10dp" | ||||
|         android:text="温馨提示" | ||||
|         android:textColor="@color/black" | ||||
|         android:textSize="16sp" /> | ||||
| 
 | ||||
|     <include layout="@layout/line_layout" /> | ||||
| 
 | ||||
|     <EditText | ||||
|         android:id="@+id/mark_edit" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:layout_margin="10dp" | ||||
|         android:background="@drawable/corners_orange_shape" | ||||
|         android:gravity="center|left" | ||||
|         android:hint="请输入处理内容" | ||||
|         android:paddingLeft="10dp" | ||||
|         android:singleLine="true" | ||||
|         android:textColor="@color/black" | ||||
|         android:textColorHint="@color/black" | ||||
|         android:textSize="14sp" /> | ||||
| 
 | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="50dp" | ||||
|         android:orientation="horizontal"> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_can" | ||||
|             style="@style/input_dialog_itemStyle" | ||||
|             android:background="@color/color_1e1f20_4" | ||||
|             android:text="取消" /> | ||||
| 
 | ||||
|         <TextView | ||||
|             android:id="@+id/tv_ok" | ||||
|             style="@style/input_dialog_itemStyle" | ||||
|             android:background="?attr/colortheme" | ||||
|             android:text="确定" | ||||
|             android:textColor="@color/white" /> | ||||
|     </LinearLayout> | ||||
| </LinearLayout> | ||||
Some files were not shown because too many files have changed in this diff Show More
					Loading…
					
					
				
		Reference in new issue