├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── build.gradle ├── hs_err_pid34060.log ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── eclass │ │ └── dogking │ │ └── com │ │ └── oneclass │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── eclass │ │ │ └── dogking │ │ │ └── com │ │ │ └── oneclass │ │ │ ├── API │ │ │ ├── ExamAPI.java │ │ │ ├── ExerciseAPI.java │ │ │ ├── FileAPI.java │ │ │ ├── LectureAPI.java │ │ │ ├── LecturecsAPI.java │ │ │ ├── LecturesonAPI.java │ │ │ ├── MessageAPI.java │ │ │ ├── PptAPI.java │ │ │ ├── TeacherAPI.java │ │ │ ├── UserAPI.java │ │ │ └── UserExerciseAPI.java │ │ │ ├── Adapter │ │ │ ├── ExamAdapter.java │ │ │ ├── ExamFinishAdapter.java │ │ │ ├── ExerciseAdapter.java │ │ │ ├── FragAdapter.java │ │ │ ├── LectureAdapter.java │ │ │ ├── LeftAdapter.java │ │ │ ├── ManageAdapter.java │ │ │ ├── Manager2Adapter.java │ │ │ ├── Manager3Adapter.java │ │ │ ├── Manager4Adapter.java │ │ │ ├── Manager4sAdapter.java │ │ │ ├── Manager5Adapter.java │ │ │ ├── Manager6Adapter.java │ │ │ ├── Manager7Adapter.java │ │ │ ├── MessageAdapter.java │ │ │ ├── MyAdapter.java │ │ │ ├── PPtAdapter.java │ │ │ ├── RightAdapter.java │ │ │ ├── RvListener.java │ │ │ └── UserExerciseAdapter.java │ │ │ ├── AdminActivity.java │ │ │ ├── AdminExercise.java │ │ │ ├── AdminNew2.java │ │ │ ├── AdminNew3.java │ │ │ ├── AdminNew4.java │ │ │ ├── AdminNew5.java │ │ │ ├── AdminNew6.java │ │ │ ├── AdminSearch.java │ │ │ ├── AdminSearch2.java │ │ │ ├── AdminSearch3.java │ │ │ ├── AdminSearch4.java │ │ │ ├── AdminSearch5.java │ │ │ ├── AdminSearch6.java │ │ │ ├── AdminUpdata1.java │ │ │ ├── AdminUpdata2.java │ │ │ ├── AdminUpdata3.java │ │ │ ├── AdminUpdata4.java │ │ │ ├── AdminUpdata5.java │ │ │ ├── Database │ │ │ ├── MyApp.java │ │ │ └── UserService.java │ │ │ ├── ExamActivity.java │ │ │ ├── ExamFinishActivity.java │ │ │ ├── ExamdetailActivity.java │ │ │ ├── ExerciseActivity.java │ │ │ ├── Fragments │ │ │ ├── Fragment1.java │ │ │ ├── Fragment2.java │ │ │ ├── Fragment3.java │ │ │ ├── Fragment4.java │ │ │ └── RightRvFragment.java │ │ │ ├── LectureActivity.java │ │ │ ├── LectureDataActivity.java │ │ │ ├── LoginActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── PasswordActivity.java │ │ │ ├── SearcheLectureActivity.java │ │ │ ├── SignActivity.java │ │ │ ├── Tab4_1Activity.java │ │ │ ├── Tab4_2Activity.java │ │ │ ├── Tab4_3Activity.java │ │ │ ├── Tab4_4Activity.java │ │ │ ├── Tab4_5Activity.java │ │ │ ├── Tab4_6Activity.java │ │ │ ├── TeacherDataActvity.java │ │ │ ├── TextLecture.java │ │ │ ├── TopBar.java │ │ │ ├── UpdatemineActivity.java │ │ │ ├── UserExerciseActivity.java │ │ │ ├── UserExercisefinishActivity.java │ │ │ ├── VideoLecture.java │ │ │ ├── WelcomeActivity.java │ │ │ ├── entiry │ │ │ ├── Course.java │ │ │ ├── Exam.java │ │ │ ├── Exercise.java │ │ │ ├── ExerciseShow.java │ │ │ ├── HttpDefault.java │ │ │ ├── Lecture.java │ │ │ ├── LectureShow.java │ │ │ ├── Lecturecs.java │ │ │ ├── Lectureson.java │ │ │ ├── MessageShow.java │ │ │ ├── PptShow.java │ │ │ ├── Teacher.java │ │ │ ├── User.java │ │ │ ├── UserExercise.java │ │ │ └── UserExerciseShow.java │ │ │ └── utils │ │ │ ├── CircleTransformation.java │ │ │ ├── FileUtils.java │ │ │ ├── GalleryfinalActionListener.java │ │ │ ├── GildeImageLoader.java │ │ │ ├── HttpDownloader.java │ │ │ ├── MGalleryFinalUtils.java │ │ │ ├── OneclassUtils.java │ │ │ ├── OpenFileUtil.java │ │ │ ├── choseDialog.java │ │ │ └── messageDialog.java │ └── res │ │ ├── anim │ │ ├── push_bottom_in.xml │ │ └── push_bottom_out.xml │ │ ├── drawable │ │ ├── course_info_blue.xml │ │ ├── course_info_blue2.xml │ │ ├── course_info_blue3.xml │ │ ├── course_info_green.xml │ │ ├── course_info_light_grey.xml │ │ ├── course_info_red.xml │ │ ├── course_info_yellow.xml │ │ ├── course_table_last_colum.xml │ │ ├── course_text_view_bg.xml │ │ ├── shape_point_select.xml │ │ └── shape_point_unselect.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_tab4_1.xml │ │ ├── activity_tab4_2.xml │ │ ├── activity_tab4_3.xml │ │ ├── activity_tab4_4.xml │ │ ├── activity_tab4_5.xml │ │ ├── activity_tab4_6.xml │ │ ├── admin_exam.xml │ │ ├── admin_exercise.xml │ │ ├── admin_exercise_son.xml │ │ ├── admin_lecture.xml │ │ ├── admin_message.xml │ │ ├── admin_ppt.xml │ │ ├── admin_tab1.xml │ │ ├── admin_tab2.xml │ │ ├── admin_tab3.xml │ │ ├── admin_tab4.xml │ │ ├── admin_tab5.xml │ │ ├── admin_tab6.xml │ │ ├── admin_tab7.xml │ │ ├── adminnew2.xml │ │ ├── adminnew3.xml │ │ ├── adminnew4.xml │ │ ├── adminnew5.xml │ │ ├── adminnew6.xml │ │ ├── adminud1.xml │ │ ├── adminud2.xml │ │ ├── adminud3.xml │ │ ├── adminud4.xml │ │ ├── adminud5.xml │ │ ├── bottombar.xml │ │ ├── dialog.xml │ │ ├── dialogphoto.xml │ │ ├── dialogview.xml │ │ ├── exam_layout.xml │ │ ├── examdetail_layout.xml │ │ ├── examfinish_layout.xml │ │ ├── exercise_layout.xml │ │ ├── exerciseitem.xml │ │ ├── item.xml │ │ ├── lecture_layout.xml │ │ ├── lecturecontent_layout.xml │ │ ├── lecturedata_tabhost1.xml │ │ ├── lecturedata_tabhost2.xml │ │ ├── lecturetitle_layout.xml │ │ ├── leturedata_layout.xml │ │ ├── login.xml │ │ ├── message.xml │ │ ├── nav_head_layout.xml │ │ ├── password.xml │ │ ├── resourceitem.xml │ │ ├── rightfragment.xml │ │ ├── search.xml │ │ ├── search2.xml │ │ ├── search3.xml │ │ ├── search4.xml │ │ ├── search5.xml │ │ ├── search6.xml │ │ ├── searchlecture.xml │ │ ├── sign.xml │ │ ├── tab1.xml │ │ ├── tab2.xml │ │ ├── tab3.xml │ │ ├── tab4.xml │ │ ├── teacherdata_layout.xml │ │ ├── testrightrv.xml │ │ ├── testweb.xml │ │ ├── textlecture_layout.xml │ │ ├── title.xml │ │ ├── updateminelayout.xml │ │ ├── userexercise_layout.xml │ │ ├── userexercisefinish.xml │ │ ├── usermanager.xml │ │ ├── videolecture_layout.xml │ │ └── welcome.xml │ │ ├── menu │ │ ├── nav_menu_layout.xml │ │ └── toolbar.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── account.png │ │ ├── actor.png │ │ ├── ad1.png │ │ ├── ad2.png │ │ ├── ad3.png │ │ ├── back_1.png │ │ ├── cb_off.png │ │ ├── cb_on.png │ │ ├── class_off.png │ │ ├── class_on.png │ │ ├── error.png │ │ ├── exam.png │ │ ├── headimp.png │ │ ├── ic_done.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_menu.png │ │ ├── ic_ocx.png │ │ ├── loading.png │ │ ├── main_off.png │ │ ├── main_on.png │ │ ├── me_off.png │ │ ├── me_on.png │ │ ├── nav_1.png │ │ ├── nav_2.png │ │ ├── nav_3.png │ │ ├── nav_4.png │ │ ├── nav_5.png │ │ ├── nav_6.png │ │ ├── nav_7.png │ │ ├── nav_8.png │ │ ├── p4_1.png │ │ ├── p4_2.png │ │ ├── p4_3.png │ │ ├── p4_4.png │ │ ├── p4_5.png │ │ ├── p4_6.png │ │ ├── p4_7.png │ │ ├── p4_8.png │ │ ├── ppt.jpg │ │ ├── refresh.png │ │ ├── search.png │ │ ├── serch.png │ │ ├── title_back.png │ │ ├── top_bar.png │ │ └── welcome.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── color.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── ids.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── eclass │ └── dogking │ └── com │ └── oneclass │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LittleDogPig/OneClassAPP/96d64f85f8daa51ea1681280e8a5a855fd56fe39/app/build.gradle -------------------------------------------------------------------------------- /app/hs_err_pid34060.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LittleDogPig/OneClassAPP/96d64f85f8daa51ea1681280e8a5a855fd56fe39/app/hs_err_pid34060.log -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in F:\android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/eclass/dogking/com/oneclass/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("eclass.dogking.com.oneclass", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/ExamAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.Exam; 6 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 7 | import eclass.dogking.com.oneclass.entiry.Lecturecs; 8 | import eclass.dogking.com.oneclass.entiry.Teacher; 9 | import io.reactivex.Observable; 10 | import retrofit2.http.Field; 11 | import retrofit2.http.FormUrlEncoded; 12 | import retrofit2.http.POST; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by dog on 2018/2/24 0024. 17 | */ 18 | 19 | public interface ExamAPI { 20 | 21 | @FormUrlEncoded 22 | @POST("exam/findexam") 23 | Observable> findExam( 24 | @Field("name") String name 25 | ); 26 | 27 | @FormUrlEncoded 28 | @POST("exam/answer") 29 | Observable> answer( 30 | @Field("tel") String tel, 31 | @Field("name") String name, 32 | @Field("answer") String answer 33 | ); 34 | 35 | @POST("exam/list") 36 | Observable>> list(); 37 | 38 | @POST("exam/deleteExam") 39 | Observable> deleteExam( 40 | @Query("id" ) int id 41 | ); 42 | 43 | @FormUrlEncoded 44 | @POST("exam/getExam") 45 | Observable>> getExam( 46 | @Field("name") String name 47 | ); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/ExerciseAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.Exercise; 6 | import eclass.dogking.com.oneclass.entiry.ExerciseShow; 7 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 8 | import eclass.dogking.com.oneclass.entiry.Lecture; 9 | import io.reactivex.Observable; 10 | import retrofit2.http.Field; 11 | import retrofit2.http.FormUrlEncoded; 12 | import retrofit2.http.POST; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by dog on 2018/2/10 0010. 17 | */ 18 | 19 | public interface ExerciseAPI { 20 | @FormUrlEncoded 21 | @POST("exercise/getexercise") 22 | Observable> getexercise( 23 | @Field("lecturename") String lecturename, 24 | @Field("name") String name 25 | 26 | ); 27 | 28 | @POST("exercise/exerciseshow") 29 | Observable>> exerciseshow(); 30 | 31 | @FormUrlEncoded 32 | @POST("exercise/getExercise") 33 | Observable>> getExercise( 34 | @Field("name") String name 35 | 36 | ); 37 | 38 | @FormUrlEncoded 39 | @POST("exercise/getexson") 40 | Observable>> getexson( 41 | @Field("name") String name 42 | 43 | ); 44 | 45 | @FormUrlEncoded 46 | @POST("exercise/deleteExercise") 47 | Observable> deleteExercise( 48 | @Field("id") int id 49 | 50 | ); 51 | 52 | @FormUrlEncoded 53 | @POST("exercise/getoneexercise") 54 | Observable> getoneexercise( 55 | @Field("id") int id 56 | ); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/FileAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.Lecture; 7 | import io.reactivex.Observable; 8 | import retrofit2.http.GET; 9 | 10 | /** 11 | * Created by dog on 2018/2/14 0014. 12 | */ 13 | 14 | public interface FileAPI { 15 | 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/LectureAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.Lecture; 7 | import eclass.dogking.com.oneclass.entiry.LectureShow; 8 | import io.reactivex.Observable; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.GET; 12 | import retrofit2.http.POST; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by dog on 2018/1/30 0030. 17 | */ 18 | 19 | public interface LectureAPI { 20 | 21 | @GET("lecture/lecturelist") 22 | Observable>> getlecturelist(); 23 | 24 | @FormUrlEncoded 25 | @POST("lecture/findlecturebyname") 26 | Observable> findlecturebyname( 27 | @Field("name") String name 28 | ); 29 | 30 | 31 | @GET("lecture/lectureshow") 32 | Observable>> getlectureshow(); 33 | 34 | @FormUrlEncoded 35 | @POST("lecture/findnamebyname") 36 | Observable> findnamenyname( 37 | @Field("name") String name 38 | ); 39 | 40 | @FormUrlEncoded 41 | @POST("lecture/findlecturelikename") 42 | Observable>> findlecturelikename( 43 | @Field("name") String name 44 | ); 45 | 46 | @FormUrlEncoded 47 | @POST("lecture/getlecturedata") 48 | Observable>> getlecturedata( 49 | @Field("name") String name 50 | ); 51 | 52 | @FormUrlEncoded 53 | @POST("lecture/deletelecture") 54 | Observable> deletelecture( 55 | @Field("name") String name 56 | ); 57 | 58 | @FormUrlEncoded 59 | @POST("lecture/getLecture") 60 | Observable>> getLecture( 61 | @Field("name") String name 62 | ); 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/LecturecsAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.Course; 6 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 7 | import eclass.dogking.com.oneclass.entiry.Lecture; 8 | import eclass.dogking.com.oneclass.entiry.LectureShow; 9 | import eclass.dogking.com.oneclass.entiry.Lecturecs; 10 | import io.reactivex.Observable; 11 | import retrofit2.http.Field; 12 | import retrofit2.http.FormUrlEncoded; 13 | import retrofit2.http.GET; 14 | import retrofit2.http.POST; 15 | import retrofit2.http.Query; 16 | 17 | /** 18 | * Created by dog on 2018/2/6 0006. 19 | */ 20 | 21 | public interface LecturecsAPI { 22 | 23 | @FormUrlEncoded 24 | @POST("lecturecs/choselecture") 25 | Observable> choselecture( 26 | @Field("name") String name, 27 | @Field("tel") String tel 28 | ); 29 | 30 | @GET("lecturecs/lecturedatashow") 31 | Observable>>> getlecturedatashow( 32 | @Query("tel") String tel 33 | ); 34 | 35 | @GET("lecturecs/lectureshow") 36 | Observable>> getlectureshow( 37 | @Query("tel") String tel 38 | ); 39 | 40 | @GET("lecturecs/getuserchose") 41 | Observable>> getuserchose( 42 | @Query("tel") String tel 43 | ); 44 | 45 | @FormUrlEncoded 46 | @POST("lecturecs/getlecturecs") 47 | Observable> getlecturecs( 48 | @Field("tel") String tel, 49 | @Field("name") String name 50 | 51 | ); 52 | 53 | @FormUrlEncoded 54 | @POST("lecturecs/unchose") 55 | Observable> unchose( 56 | @Field("tel") String tel, 57 | @Field("name") String name 58 | ); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/LecturesonAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.Lecturecs; 7 | import eclass.dogking.com.oneclass.entiry.Lectureson; 8 | import io.reactivex.Observable; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.POST; 12 | 13 | /** 14 | * Created by dog on 2018/2/15 0015. 15 | */ 16 | 17 | public interface LecturesonAPI { 18 | 19 | 20 | @FormUrlEncoded 21 | @POST("lectureson/getlectureson") 22 | Observable>> getlectureson( 23 | @Field("name") String name 24 | ); 25 | 26 | @FormUrlEncoded 27 | @POST("lectureson/getoneson") 28 | Observable> getoneson( 29 | @Field("id") int id 30 | ); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/MessageAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.LectureShow; 7 | import eclass.dogking.com.oneclass.entiry.MessageShow; 8 | import io.reactivex.Observable; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.GET; 12 | import retrofit2.http.POST; 13 | 14 | /** 15 | * Created by dog on 2018/2/21 0021. 16 | */ 17 | 18 | public interface MessageAPI { 19 | 20 | @GET("message/messageshow") 21 | Observable>> getmessageshow(); 22 | 23 | @FormUrlEncoded 24 | @POST("message/save") 25 | Observable>> save( 26 | @Field("tel") String tel, 27 | @Field("description") String description 28 | ); 29 | 30 | @FormUrlEncoded 31 | @POST("message/deletetmessage") 32 | Observable> deletetmessage( 33 | @Field("id") int id 34 | 35 | ); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/PptAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.Exam; 6 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 7 | import eclass.dogking.com.oneclass.entiry.PptShow; 8 | import io.reactivex.Observable; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.POST; 12 | 13 | /** 14 | * Created by dog on 2018/2/25 0025. 15 | */ 16 | 17 | public interface PptAPI { 18 | 19 | @FormUrlEncoded 20 | @POST("ppt/pptshow") 21 | Observable>> pptshow( 22 | @Field("tel") String tel 23 | ); 24 | 25 | @FormUrlEncoded 26 | @POST("ppt/deletePPT") 27 | Observable> deletePPT( 28 | @Field("id") int id 29 | ); 30 | 31 | @POST("ppt/pptlistShow") 32 | Observable>> pptlistShow(); 33 | 34 | @FormUrlEncoded 35 | @POST("ppt/getPPT") 36 | Observable>> getPPT( 37 | @Field("name") String name 38 | ); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/TeacherAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.Teacher; 7 | import eclass.dogking.com.oneclass.entiry.User; 8 | import io.reactivex.Observable; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.GET; 12 | import retrofit2.http.POST; 13 | import retrofit2.http.Query; 14 | /** 15 | * Created by dog on 2018/2/4 0004. 16 | */ 17 | 18 | public interface TeacherAPI { 19 | 20 | @FormUrlEncoded 21 | @POST("teacher/findTeacherByName") 22 | Observable> findNameByName( 23 | @Field("name") String name 24 | ); 25 | 26 | @GET("teacher/teacherlist") 27 | Observable>> teacherlist(); 28 | 29 | @FormUrlEncoded 30 | @POST("teacher/getTeacher") 31 | Observable>> getTeacher( 32 | @Field("name") String name 33 | ); 34 | 35 | //删除用户 36 | @POST("teacher/deleteteacher") 37 | Observable> deleteteacher( 38 | @Query("id") int id 39 | ); 40 | 41 | @FormUrlEncoded 42 | @POST("teacher/newteacher") 43 | Observable> newteacher( 44 | @Field("name") String name, 45 | @Field("email") String email, 46 | @Field("school") String school, 47 | @Field("sex") String sex, 48 | @Field("description") String description 49 | ); 50 | 51 | @FormUrlEncoded 52 | @POST("teacher/udteacher") 53 | Observable> udteacher( 54 | @Field("id") int id, 55 | @Field("name") String name, 56 | @Field("email") String email, 57 | @Field("school") String school, 58 | @Field("sex") String sex, 59 | @Field("description") String description 60 | ); 61 | 62 | @POST("teacher/findTeacher") 63 | Observable> findTeacher( 64 | @Query("id") int id 65 | ); 66 | 67 | 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/UserAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.User; 7 | import io.reactivex.Observable; 8 | import okhttp3.MultipartBody; 9 | import retrofit2.http.Field; 10 | import retrofit2.http.FormUrlEncoded; 11 | import retrofit2.http.GET; 12 | import retrofit2.http.Multipart; 13 | import retrofit2.http.POST; 14 | import retrofit2.http.Part; 15 | import retrofit2.http.Query; 16 | 17 | /** 18 | * Created by weij on 2017/12/23. 19 | */ 20 | 21 | public interface UserAPI { 22 | 23 | //登录 24 | @POST("user/login") 25 | Observable> login( 26 | @Query("tel") String tel, 27 | @Query("password") String password 28 | ); 29 | 30 | //注册 31 | @POST("user/register") 32 | Observable> register( 33 | @Query("tel") String tel, 34 | @Query("password") String password 35 | ); 36 | 37 | 38 | //重置密码 39 | @POST("user/resetpsd") 40 | Observable> resetPassword( 41 | @Query("tel") String tel, 42 | @Query("oldpsd") String oldpsd, 43 | @Query("newpsd") String newpsd 44 | ); 45 | 46 | 47 | //用户id查询用户信息 48 | @POST("user/QueryUser") 49 | Observable> queryUser( 50 | @Query("userid") int userid 51 | ); 52 | 53 | //用户手机查询用户信息 54 | @POST("user/QueryUserbyPhone") 55 | Observable> queryUserbyPhone( 56 | @Query("tel") String tel 57 | ); 58 | 59 | //更新个人信息 60 | @FormUrlEncoded 61 | @POST("user/updatemine") 62 | Observable> updatemine( 63 | @Field("name") String name, 64 | @Field("sex") String sex, 65 | @Field("description") String description, 66 | @Field("tel") String tel 67 | ); 68 | 69 | @GET("user/userlist") 70 | Observable>> userlist(); 71 | 72 | @GET("user/getuser") 73 | Observable>> getuser( 74 | @Query("tel") String tel 75 | 76 | ); 77 | 78 | 79 | 80 | //设置用户头像 81 | @Multipart 82 | @POST("file/upload") 83 | Observable> updateHeadImg( 84 | @Query("tel") String tel, 85 | @Part MultipartBody.Part file 86 | ); 87 | //删除用户 88 | @POST("user/deleteuser") 89 | Observable> deleteuser( 90 | @Query("id") int id 91 | ); 92 | 93 | 94 | //更新个人信息 95 | @FormUrlEncoded 96 | @POST("user/updateUser") 97 | Observable> updatUser( 98 | @Field("id") int id, 99 | @Field("name") String name, 100 | @Field("tel") String tel, 101 | @Field("password") String password, 102 | @Field("sex") String sex, 103 | @Field("description") String description 104 | 105 | ); 106 | 107 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/API/UserExerciseAPI.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.API; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.HttpDefault; 6 | import eclass.dogking.com.oneclass.entiry.User; 7 | import eclass.dogking.com.oneclass.entiry.UserExercise; 8 | import eclass.dogking.com.oneclass.entiry.UserExerciseShow; 9 | import io.reactivex.Observable; 10 | import retrofit2.http.Field; 11 | import retrofit2.http.FormUrlEncoded; 12 | import retrofit2.http.POST; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by dog on 2018/2/10 0010. 17 | */ 18 | 19 | public interface UserExerciseAPI { 20 | 21 | @FormUrlEncoded 22 | @POST("userexercise/getrecordshow") 23 | Observable>> getrecordshow( 24 | @Field("tel") String tel, 25 | @Field("name") String name 26 | ); 27 | 28 | @FormUrlEncoded 29 | @POST("userexercise/answer") 30 | Observable> answer( 31 | @Field("tel") String tel, 32 | @Field("name") String name, 33 | @Field("lecturename") String lecturename, 34 | @Field("answer") String answer 35 | ); 36 | 37 | @FormUrlEncoded 38 | @POST("userexercise/getuserrecord") 39 | Observable> getrecord( 40 | @Field("tel") String tel, 41 | @Field("name") String name, 42 | @Field("lecturename") String lecturename 43 | ); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/FragAdapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import java.util.List; 8 | 9 | public class FragAdapter extends FragmentPagerAdapter { 10 | 11 | private List mFragments; 12 | 13 | public FragAdapter(FragmentManager fm) { 14 | super(fm); 15 | } 16 | 17 | public FragAdapter(FragmentManager fm, List list) { 18 | super(fm); 19 | this.mFragments= list; 20 | } 21 | 22 | @Override 23 | public Fragment getItem(int arg0) { 24 | // TODO Auto-generated method stub 25 | return mFragments.get(arg0); 26 | } 27 | 28 | @Override 29 | public int getCount() { 30 | // TODO Auto-generated method stub 31 | return mFragments.size(); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/Manager6Adapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.Button; 9 | import android.widget.TextView; 10 | 11 | import java.util.List; 12 | 13 | import eclass.dogking.com.oneclass.R; 14 | import eclass.dogking.com.oneclass.entiry.Exam; 15 | import eclass.dogking.com.oneclass.entiry.LectureShow; 16 | import eclass.dogking.com.oneclass.entiry.PptShow; 17 | 18 | /** 19 | * Created by dog on 2018/3/10 0010. 20 | */ 21 | 22 | public class Manager6Adapter extends RecyclerView.Adapter { 23 | 24 | private List list; 25 | private Context mContext; 26 | private LayoutInflater inflater; 27 | protected RvListener listener; 28 | 29 | public Manager6Adapter(Context context, List pptShows, RvListener listener) { 30 | this.list = pptShows; 31 | this.mContext = context; 32 | this.listener = listener; 33 | inflater = LayoutInflater.from(mContext); 34 | } 35 | 36 | //创建新View,被LayoutManager所调用 37 | @Override 38 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { 39 | View view = inflater.inflate(R.layout.admin_ppt, viewGroup, false); 40 | ViewHolder vh = new ViewHolder(view,listener); 41 | return vh; 42 | } 43 | 44 | //将数据与界面进行绑定的操作 45 | @Override 46 | public void onBindViewHolder(final ViewHolder viewHolder, int position) { 47 | final PptShow pptShow= list.get(position); 48 | viewHolder.t1.setText(pptShow.getName()); 49 | 50 | 51 | 52 | viewHolder.itemView.setOnClickListener(new View.OnClickListener() { 53 | public void onClick(View v) { 54 | int position = viewHolder.getAdapterPosition(); 55 | //UserExerciseShow userExerciseShow1 = ExerciseShows.get(position); 56 | 57 | //Toast.makeText(v.getContext(),"你点击的课为:"+lectureShow1.getLectureName(),Toast.LENGTH_SHORT).show(); 58 | } 59 | 60 | }); 61 | 62 | 63 | } 64 | 65 | //获取数据的数量 66 | @Override 67 | public int getItemCount() { 68 | return list == null ? 0 : list.size(); 69 | } 70 | 71 | 72 | //自定义的ViewHolder,持有每个Item的的所有界面元素 73 | public static class ViewHolder extends RecyclerView.ViewHolder { 74 | public TextView t1; 75 | public Button b1; 76 | protected RvListener mListener; 77 | 78 | public ViewHolder(View view,RvListener listener) { 79 | super(view); 80 | this.mListener=listener; 81 | t1 = (TextView) view.findViewById(R.id.name); 82 | b1=(Button) view.findViewById(R.id.delete); 83 | 84 | b1.setOnClickListener(new View.OnClickListener() { 85 | @Override 86 | public void onClick(View v) { 87 | mListener.onItemClick(v.getId(), getAdapterPosition()); 88 | } 89 | }); 90 | 91 | } 92 | 93 | } 94 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/MessageAdapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.bumptech.glide.Glide; 13 | 14 | import java.util.List; 15 | 16 | import de.hdodenhof.circleimageview.CircleImageView; 17 | import eclass.dogking.com.oneclass.LectureActivity; 18 | import eclass.dogking.com.oneclass.R; 19 | import eclass.dogking.com.oneclass.entiry.LectureShow; 20 | import eclass.dogking.com.oneclass.entiry.MessageShow; 21 | import eclass.dogking.com.oneclass.utils.OneclassUtils; 22 | 23 | /** 24 | * Created by dog on 2018/2/21 0021. 25 | */ 26 | 27 | 28 | public class MessageAdapter extends RecyclerView.Adapter { 29 | 30 | private List list; 31 | private Context mContext; 32 | private LayoutInflater inflater; 33 | 34 | public MessageAdapter(Context context,List list) { 35 | this.list=list; 36 | this.mContext=context; 37 | inflater=LayoutInflater. from(mContext); 38 | } 39 | //创建新View,被LayoutManager所调用 40 | @Override 41 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { 42 | View view =inflater.inflate(R.layout.message,viewGroup,false); 43 | ViewHolder vh = new ViewHolder(view); 44 | return vh; 45 | } 46 | //将数据与界面进行绑定的操作 47 | @Override 48 | public void onBindViewHolder(final ViewHolder viewHolder, int position) { 49 | MessageShow messageShow=list.get(position); 50 | viewHolder.name.setText(messageShow.getName()); 51 | viewHolder.descrition.setText(messageShow.getDescription()); 52 | viewHolder.message.setText(messageShow.getMessage()); 53 | viewHolder.time.setText(messageShow.getTime()); 54 | Glide.with(mContext).load(OneclassUtils.getBaseURL()+messageShow.getHeadimg()).centerCrop().error(R.mipmap.error).dontAnimate().into(viewHolder.head); 55 | //.override(100, 100) .fitCenter() 56 | 57 | 58 | 59 | } 60 | //获取数据的数量 61 | @Override 62 | public int getItemCount() { 63 | return list == null ? 0 : list.size(); 64 | } 65 | 66 | 67 | //自定义的ViewHolder,持有每个Item的的所有界面元素 68 | public static class ViewHolder extends RecyclerView.ViewHolder { 69 | public CircleImageView head; 70 | public TextView name; 71 | public TextView descrition; 72 | public TextView message; 73 | public TextView time; 74 | public ViewHolder(View view){ 75 | super(view); 76 | head=(CircleImageView)view.findViewById(R.id.head); 77 | name = (TextView) view.findViewById(R.id.name); 78 | descrition=(TextView) view.findViewById(R.id.description); 79 | message = (TextView) view.findViewById(R.id.message); 80 | time=(TextView) view.findViewById(R.id.time); 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/MyAdapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.bumptech.glide.Glide; 15 | 16 | import java.util.List; 17 | 18 | import eclass.dogking.com.oneclass.LectureActivity; 19 | import eclass.dogking.com.oneclass.R; 20 | import eclass.dogking.com.oneclass.entiry.LectureShow; 21 | import eclass.dogking.com.oneclass.utils.OneclassUtils; 22 | 23 | public class MyAdapter extends RecyclerView.Adapter { 24 | 25 | private List lectureShows; 26 | private String tel; 27 | private Context mContext; 28 | private LayoutInflater inflater; 29 | 30 | public MyAdapter(Context context,List lectureShows,String tel) { 31 | this.lectureShows = lectureShows; 32 | this.mContext=context; 33 | this.tel=tel; 34 | inflater=LayoutInflater. from(mContext); 35 | } 36 | //创建新View,被LayoutManager所调用 37 | @Override 38 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { 39 | View view =inflater.inflate(R.layout.item,viewGroup,false); 40 | ViewHolder vh = new ViewHolder(view); 41 | return vh; 42 | } 43 | //将数据与界面进行绑定的操作 44 | @Override 45 | public void onBindViewHolder(final ViewHolder viewHolder, int position) { 46 | LectureShow lectureShow=lectureShows.get(position); 47 | viewHolder.t1.setText(lectureShow.getLectureName()); 48 | viewHolder.t2.setText(lectureShow.getTeacherName()); 49 | Glide.with(mContext).load(OneclassUtils.getBaseURL()+lectureShow.getPictureUrl()).centerCrop().placeholder(R.mipmap.loading).error(R.mipmap.error).dontAnimate().into(viewHolder.i1); 50 | //.override(100, 100) .fitCenter() 51 | 52 | viewHolder.itemView.setOnClickListener(new View.OnClickListener(){ 53 | public void onClick(View v){ 54 | int position =viewHolder.getAdapterPosition(); 55 | LectureShow lectureShow1=lectureShows.get(position); 56 | Intent intent = new Intent(v.getContext(),LectureActivity.class); 57 | intent.putExtra("name",lectureShow1.getLectureName());//传递课程 58 | intent.putExtra("tel",tel);//传递登录的用户 59 | v.getContext().startActivity(intent); 60 | //Toast.makeText(v.getContext(),"你点击的课为:"+lectureShow1.getLectureName(),Toast.LENGTH_SHORT).show(); 61 | } 62 | 63 | }); 64 | 65 | 66 | } 67 | //获取数据的数量 68 | @Override 69 | public int getItemCount() { 70 | return lectureShows == null ? 0 : lectureShows.size(); 71 | } 72 | 73 | 74 | //自定义的ViewHolder,持有每个Item的的所有界面元素 75 | public static class ViewHolder extends RecyclerView.ViewHolder { 76 | public TextView t1; 77 | public TextView t2; 78 | public ImageView i1; 79 | public ViewHolder(View view){ 80 | super(view); 81 | t1 = (TextView) view.findViewById(R.id.name_lecture); 82 | t2=(TextView) view.findViewById(R.id.name_teacher); 83 | i1=(ImageView)view.findViewById(R.id.picture_lecture); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/PPtAdapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | import android.content.Context; 4 | import android.graphics.Color; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.TextView; 10 | 11 | import java.util.List; 12 | 13 | import eclass.dogking.com.oneclass.R; 14 | import eclass.dogking.com.oneclass.entiry.PptShow; 15 | 16 | /** 17 | * Created by dog on 2018/2/25 0025. 18 | */ 19 | public class PPtAdapter extends RecyclerView.Adapter { 20 | private Context mContext; 21 | private LayoutInflater inflater; 22 | private List list; 23 | protected RvListener listener; 24 | private int checkedPosition; 25 | 26 | public PPtAdapter(Context context, List list, RvListener listener) { 27 | this.list = list; 28 | this.mContext = context; 29 | this.listener = listener; 30 | inflater = LayoutInflater.from(mContext); 31 | } 32 | 33 | //创建新View,被LayoutManager所调用 34 | @Override 35 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { 36 | View view = inflater.inflate(R.layout.resourceitem, viewGroup, false); 37 | ViewHolder vh = new ViewHolder(view,listener); 38 | return vh; 39 | } 40 | 41 | //将数据与界面进行绑定的操作 42 | @Override 43 | public void onBindViewHolder(final ViewHolder viewHolder, final int position) { 44 | viewHolder.t1.setText(list.get(position).getName()); 45 | 46 | } 47 | 48 | 49 | //获取数据的数量 50 | @Override 51 | public int getItemCount() { 52 | return list == null ? 0 : list.size(); 53 | } 54 | 55 | 56 | //自定义的ViewHolder,持有每个Item的的所有界面元素 57 | public class ViewHolder extends RecyclerView.ViewHolder { 58 | private TextView t1; 59 | private View mview; 60 | protected RvListener mListener; 61 | 62 | public ViewHolder(View view,RvListener listener) { 63 | super(view); 64 | this.mListener=listener; 65 | this.mview=view; 66 | t1 = (TextView) view.findViewById(R.id.name); 67 | view.setOnClickListener(new View.OnClickListener() { 68 | @Override 69 | public void onClick(View v) { 70 | mListener.onItemClick(v.getId(), getAdapterPosition()); 71 | } 72 | }); 73 | 74 | } 75 | 76 | 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/RightAdapter.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import com.bumptech.glide.Glide; 14 | 15 | import java.util.List; 16 | 17 | import eclass.dogking.com.oneclass.LectureActivity; 18 | import eclass.dogking.com.oneclass.R; 19 | import eclass.dogking.com.oneclass.entiry.LectureShow; 20 | import eclass.dogking.com.oneclass.utils.OneclassUtils; 21 | 22 | /** 23 | * Created by dog on 2018/2/12 0012. 24 | */ 25 | 26 | 27 | public class RightAdapter extends RecyclerView.Adapter { 28 | private Context mContext; 29 | private LayoutInflater inflater; 30 | private List list; 31 | 32 | public RightAdapter(Context context,List list) { 33 | this.list=list; 34 | this.mContext=context; 35 | inflater=LayoutInflater. from(mContext); 36 | } 37 | //创建新View,被LayoutManager所调用 38 | @Override 39 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { 40 | View view =inflater.inflate(R.layout.testrightrv,viewGroup,false); 41 | ViewHolder vh = new ViewHolder(view); 42 | return vh; 43 | } 44 | //将数据与界面进行绑定的操作 45 | @Override 46 | public void onBindViewHolder(final ViewHolder viewHolder, final int position) { 47 | viewHolder.t1.setText(list.get(position)); 48 | viewHolder.itemView.setOnClickListener(new View.OnClickListener(){ 49 | public void onClick(View v){ 50 | Toast.makeText(v.getContext(),"你点击的课为:"+list.get(position),Toast.LENGTH_SHORT).show(); 51 | } 52 | 53 | }); 54 | 55 | 56 | } 57 | 58 | 59 | //获取数据的数量 60 | @Override 61 | public int getItemCount() { 62 | return list == null ? 0 : list.size(); 63 | } 64 | 65 | 66 | //自定义的ViewHolder,持有每个Item的的所有界面元素 67 | public static class ViewHolder extends RecyclerView.ViewHolder { 68 | public TextView t1; 69 | public ViewHolder(View view){ 70 | super(view); 71 | t1 = (TextView) view.findViewById(R.id.t1); 72 | 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Adapter/RvListener.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Adapter; 2 | 3 | /** 4 | * Created by dog on 2018/2/12 0012. 5 | */ 6 | 7 | public interface RvListener { 8 | 9 | void onItemClick(int id, int position); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminNew3.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminNew3 extends AppCompatActivity { 20 | 21 | @BindView(R.id.edit1) 22 | EditText edit1; 23 | @BindView(R.id.edit2) 24 | EditText edit2; 25 | @BindView(R.id.edit3) 26 | EditText edit3; 27 | @BindView(R.id.edit4) 28 | EditText edit4; 29 | @BindView(R.id.edit5) 30 | EditText edit5; 31 | @BindView(R.id.udbutton) 32 | Button udbutton; 33 | @BindView(R.id.udbutton2) 34 | Button udbutton2; 35 | 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | requestWindowFeature(Window.FEATURE_NO_TITLE); 39 | setContentView(R.layout.adminnew3); 40 | ButterKnife.bind(this); 41 | } 42 | 43 | 44 | @OnClick({R.id.udbutton, R.id.udbutton2}) 45 | public void onClick(View view) { 46 | String text1 = edit1.getText().toString(); 47 | String text2 = edit2.getText().toString(); 48 | String text3 = edit3.getText().toString(); 49 | String text4 = edit4.getText().toString(); 50 | String text5 = edit5.getText().toString(); 51 | 52 | switch (view.getId()) { 53 | case R.id.udbutton: 54 | if (!((text1.length() < 1) || (text2.length() < 1) || (text3.length() < 1) || (text4.length() < 1) || (text5.length() < 1))) { 55 | Toast.makeText(AdminNew3.this, "增加成功", Toast.LENGTH_SHORT).show(); 56 | finish(); 57 | } else Toast.makeText(AdminNew3.this, "请填写完整信息", Toast.LENGTH_SHORT).show(); 58 | 59 | break; 60 | case R.id.udbutton2: 61 | finish(); 62 | 63 | break; 64 | 65 | 66 | } 67 | 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminNew4.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminNew4 extends AppCompatActivity { 20 | 21 | @BindView(R.id.edit1) 22 | EditText edit1; 23 | @BindView(R.id.edit2) 24 | EditText edit2; 25 | @BindView(R.id.edit3) 26 | EditText edit3; 27 | @BindView(R.id.edit5) 28 | EditText edit5; 29 | @BindView(R.id.udbutton) 30 | Button udbutton; 31 | @BindView(R.id.udbutton2) 32 | Button udbutton2; 33 | 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | requestWindowFeature(Window.FEATURE_NO_TITLE); 37 | setContentView(R.layout.adminnew4); 38 | ButterKnife.bind(this); 39 | } 40 | 41 | @OnClick({R.id.udbutton,R.id.udbutton2}) 42 | public void onClick(View view){ 43 | String text1=edit1.getText().toString(); 44 | String text2=edit2.getText().toString(); 45 | String text3=edit3.getText().toString(); 46 | String text5=edit5.getText().toString(); 47 | 48 | 49 | 50 | switch (view.getId()){ 51 | case R.id.udbutton: 52 | if (!((text1.length() < 1) || (text2.length() < 1) || (text3.length() < 1)|| (text5.length() < 1))) 53 | {Toast.makeText(AdminNew4.this,"增加成功",Toast.LENGTH_SHORT).show(); 54 | finish();} 55 | else 56 | Toast.makeText(AdminNew4.this,"请输入完整信息",Toast.LENGTH_SHORT).show(); 57 | 58 | break; 59 | case R.id.udbutton2: 60 | finish(); 61 | 62 | break; 63 | 64 | 65 | 66 | 67 | } 68 | 69 | } 70 | 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminNew5.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminNew5 extends AppCompatActivity { 20 | 21 | @BindView(R.id.edit1) 22 | EditText edit1; 23 | @BindView(R.id.edit2) 24 | EditText edit2; 25 | @BindView(R.id.edit5) 26 | EditText edit5; 27 | @BindView(R.id.udbutton) 28 | Button udbutton; 29 | @BindView(R.id.udbutton2) 30 | Button udbutton2; 31 | 32 | protected void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | requestWindowFeature(Window.FEATURE_NO_TITLE); 35 | setContentView(R.layout.adminnew5); 36 | ButterKnife.bind(this); 37 | } 38 | 39 | @OnClick({R.id.udbutton, R.id.udbutton2}) 40 | public void onClick(View view) { 41 | String text1 = edit1.getText().toString(); 42 | String text2 = edit2.getText().toString(); 43 | String text5 = edit5.getText().toString(); 44 | 45 | switch (view.getId()) { 46 | case R.id.udbutton: 47 | if (!((text1.length() < 1) || (text2.length() < 1) || (text5.length() < 1))) { 48 | Toast.makeText(AdminNew5.this, "增加成功", Toast.LENGTH_SHORT).show(); 49 | finish(); 50 | } else Toast.makeText(AdminNew5.this, "请填写完整信息", Toast.LENGTH_SHORT).show(); 51 | 52 | break; 53 | case R.id.udbutton2: 54 | finish(); 55 | 56 | break; 57 | 58 | 59 | } 60 | 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminNew6.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminNew6 extends AppCompatActivity { 20 | 21 | @BindView(R.id.edit1) 22 | EditText edit1; 23 | @BindView(R.id.edit2) 24 | EditText edit2; 25 | @BindView(R.id.edit3) 26 | EditText edit3; 27 | @BindView(R.id.edit5) 28 | EditText edit5; 29 | @BindView(R.id.udbutton) 30 | Button udbutton; 31 | @BindView(R.id.udbutton2) 32 | Button udbutton2; 33 | 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | requestWindowFeature(Window.FEATURE_NO_TITLE); 37 | setContentView(R.layout.adminnew6); 38 | ButterKnife.bind(this); 39 | } 40 | 41 | @OnClick({R.id.udbutton,R.id.udbutton2}) 42 | public void onClick(View view){ 43 | String text1=edit1.getText().toString(); 44 | String text2=edit2.getText().toString(); 45 | String text3=edit3.getText().toString(); 46 | String text5=edit5.getText().toString(); 47 | 48 | 49 | 50 | switch (view.getId()){ 51 | case R.id.udbutton: 52 | if (!((text1.length() < 1) || (text2.length() < 1) || (text3.length() < 1)|| (text5.length() < 1))) 53 | { 54 | Toast.makeText(AdminNew6.this,"上传成功",Toast.LENGTH_SHORT).show(); 55 | finish(); 56 | } 57 | 58 | else Toast.makeText(AdminNew6.this,"请填写完整信息",Toast.LENGTH_SHORT).show(); 59 | 60 | break; 61 | case R.id.udbutton2: 62 | finish(); 63 | 64 | break; 65 | 66 | 67 | 68 | 69 | } 70 | 71 | } 72 | 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminUpdata3.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminUpdata3 extends AppCompatActivity { 20 | @BindView(R.id.edit1) 21 | EditText edit1; 22 | @BindView(R.id.edit2) 23 | EditText edit2; 24 | @BindView(R.id.edit3) 25 | EditText edit3; 26 | @BindView(R.id.edit4) 27 | EditText edit4; 28 | @BindView(R.id.edit5) 29 | EditText edit5; 30 | @BindView(R.id.udbutton) 31 | Button udbutton; 32 | @BindView(R.id.udbutton2) 33 | Button udbutton2; 34 | 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | requestWindowFeature(Window.FEATURE_NO_TITLE); 38 | setContentView(R.layout.adminud3); 39 | ButterKnife.bind(this); 40 | } 41 | 42 | @OnClick({R.id.udbutton,R.id.udbutton2}) 43 | public void onClick(View view){ 44 | String text1=edit1.getText().toString(); 45 | String text2=edit2.getText().toString(); 46 | String text3=edit3.getText().toString(); 47 | String text4=edit4.getText().toString(); 48 | String text5=edit5.getText().toString(); 49 | 50 | switch (view.getId()){ 51 | case R.id.udbutton: 52 | if (!((text1.length() < 1) || (text2.length() < 1) || (text3.length() < 1)|| (text4.length() < 1)|| (text5.length() < 1))) { 53 | Toast.makeText(AdminUpdata3.this, "修改成功", Toast.LENGTH_SHORT).show(); 54 | finish(); 55 | } 56 | else Toast.makeText(AdminUpdata3.this,"请填写完整信息",Toast.LENGTH_SHORT).show(); 57 | 58 | break; 59 | case R.id.udbutton2: 60 | finish(); 61 | 62 | break; 63 | 64 | 65 | 66 | 67 | } 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/AdminUpdata5.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import butterknife.BindView; 12 | import butterknife.ButterKnife; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * Created by dog on 2018/3/10 0010. 17 | */ 18 | 19 | public class AdminUpdata5 extends AppCompatActivity { 20 | @BindView(R.id.edit1) 21 | EditText edit1; 22 | @BindView(R.id.edit2) 23 | EditText edit2; 24 | @BindView(R.id.edit5) 25 | EditText edit5; 26 | @BindView(R.id.udbutton) 27 | Button udbutton; 28 | @BindView(R.id.udbutton2) 29 | Button udbutton2; 30 | 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | requestWindowFeature(Window.FEATURE_NO_TITLE); 34 | setContentView(R.layout.adminud5); 35 | ButterKnife.bind(this); 36 | } 37 | 38 | @OnClick({R.id.udbutton, R.id.udbutton2}) 39 | public void onClick(View view) { 40 | String text1 = edit1.getText().toString(); 41 | String text2 = edit2.getText().toString(); 42 | String text5 = edit5.getText().toString(); 43 | 44 | switch (view.getId()) { 45 | case R.id.udbutton: 46 | if (!((text1.length() < 1) || (text2.length() < 1) || (text5.length() < 1))) { 47 | Toast.makeText(AdminUpdata5.this, "修改成功", Toast.LENGTH_SHORT).show(); 48 | finish(); 49 | } else Toast.makeText(AdminUpdata5.this, "请填写完整信息", Toast.LENGTH_SHORT).show(); 50 | 51 | break; 52 | case R.id.udbutton2: 53 | finish(); 54 | 55 | break; 56 | 57 | 58 | } 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Database/MyApp.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Database; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | 7 | import com.liulishuo.filedownloader.FileDownloader; 8 | 9 | import eclass.dogking.com.oneclass.utils.GildeImageLoader; 10 | import io.realm.Realm; 11 | import io.realm.RealmConfiguration; 12 | 13 | 14 | 15 | import cn.finalteam.galleryfinal.CoreConfig; 16 | import cn.finalteam.galleryfinal.FunctionConfig; 17 | import cn.finalteam.galleryfinal.GalleryFinal; 18 | import cn.finalteam.galleryfinal.ImageLoader; 19 | import cn.finalteam.galleryfinal.ThemeConfig; 20 | import cn.finalteam.galleryfinal.*; 21 | 22 | /** 23 | * Author LYJ 24 | * Created on 2017/2/9. 25 | * Time 11:35 26 | */ 27 | 28 | public class MyApp extends Application{ 29 | private static Context context = null; 30 | private static MyApp myApplication; 31 | 32 | public static MyApp getInstance(){ 33 | 34 | if (myApplication==null){ 35 | myApplication = new MyApp(); 36 | } 37 | 38 | return myApplication; 39 | } 40 | 41 | 42 | @Override 43 | public void onCreate() { 44 | super.onCreate(); 45 | context = getApplicationContext(); 46 | initGalleryFinal(); 47 | } 48 | private void initrealm(){ 49 | Realm.init(this);//初始化Realm 50 | RealmConfiguration configuration = new RealmConfiguration.Builder() 51 | .name("mineRealm.realm")//设置数据库名称 52 | .schemaVersion(0)//设置版本号 53 | .build(); 54 | 55 | Realm.setDefaultConfiguration(configuration);//设置配置 56 | 57 | 58 | } 59 | 60 | /*************************************** 61 | * 初始化galleryfinal 62 | */ 63 | 64 | private void initGalleryFinal() { 65 | 66 | //配置主题 67 | ThemeConfig theme = new ThemeConfig.Builder() 68 | .build(); 69 | //配置功能 70 | FunctionConfig functionConfig = new FunctionConfig.Builder() 71 | .setEnableCamera(true) 72 | .setEnableEdit(true) 73 | .setEnableCrop(true) 74 | .setEnableRotate(true) 75 | .setCropSquare(true) 76 | .setEnablePreview(true) 77 | .build(); 78 | //配置imageloader 79 | ImageLoader imageloader = new GildeImageLoader(); 80 | //设置核心配置信息 81 | CoreConfig coreConfig = new CoreConfig.Builder(context, imageloader, theme) 82 | .setFunctionConfig(functionConfig) 83 | .build(); 84 | GalleryFinal.init(coreConfig); 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Database/UserService.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Database; 2 | 3 | import java.util.List; 4 | 5 | import eclass.dogking.com.oneclass.entiry.User; 6 | import io.realm.Realm; 7 | import io.realm.RealmResults; 8 | 9 | 10 | 11 | public class UserService { 12 | private Realm realm; 13 | 14 | public UserService(Realm realm){ 15 | this.realm=realm; 16 | } 17 | /* 18 | public boolean Canlogin(String account,String password){ 19 | RealmResults userList = realm.where(User.class) 20 | .equalTo("Account", account) 21 | .equalTo("Password", password) 22 | .findAll(); 23 | 24 | if (userList.size() == 0){//size为0则表示没有数据,没有此账号 25 | return false; 26 | } 27 | else return true; 28 | } 29 | 30 | public boolean CanSign(String account){ 31 | RealmResults userList = realm.where(User.class) 32 | .equalTo("Account", account) 33 | .findAll(); 34 | 35 | if (userList.size() == 0){//size为0则表示没有数据,可以注册 36 | return true; 37 | } 38 | else return false; 39 | 40 | 41 | }*/ 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/Fragments/RightRvFragment.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.Fragments; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.DividerItemDecoration; 7 | import android.support.v7.widget.LinearLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | 13 | import java.util.ArrayList; 14 | import java.util.List; 15 | 16 | import butterknife.BindView; 17 | import butterknife.ButterKnife; 18 | import butterknife.Unbinder; 19 | import eclass.dogking.com.oneclass.Adapter.RightAdapter; 20 | import eclass.dogking.com.oneclass.R; 21 | 22 | /** 23 | * Created by dog on 2018/2/12 0012. 24 | */ 25 | 26 | public class RightRvFragment extends Fragment { 27 | @BindView(R.id.rv) 28 | RecyclerView rv; 29 | Unbinder unbinder; 30 | private List> mylist; 31 | private int mIndex = 0; 32 | private RightAdapter rightAdapter; 33 | private List list; 34 | private Context context; 35 | private LinearLayoutManager mLinearLayoutManager; 36 | 37 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 38 | Bundle savedInstanceState) { 39 | // TODO Auto-generated method stub 40 | View view = inflater.inflate(R.layout.rightfragment, container, false); 41 | 42 | //对View中控件的操作方法 43 | 44 | unbinder = ButterKnife.bind(this, view); 45 | return view; 46 | } 47 | 48 | 49 | public void setData(int n) { 50 | mIndex = n; 51 | } 52 | 53 | protected void initview(){ 54 | context = this.getContext(); 55 | mLinearLayoutManager = new LinearLayoutManager(context); 56 | rv.setLayoutManager(mLinearLayoutManager); 57 | rv.addItemDecoration(new DividerItemDecoration(context,DividerItemDecoration.VERTICAL)); 58 | 59 | 60 | } 61 | 62 | 63 | protected void initData() { 64 | for(int i=0;i<5;i++){ 65 | List list=new ArrayList<>(); 66 | list.add(i+""); 67 | list.add(i+""); 68 | list.add(i+""); 69 | list.add(i+""); 70 | list.add(i+""); 71 | mylist.add(list); 72 | } 73 | //rightAdapter=new RightAdapter(context,mylist); 74 | //rv.setAdapter(rightAdapter); 75 | } 76 | @Override 77 | public void onDestroyView() { 78 | super.onDestroyView(); 79 | unbinder.unbind(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/TopBar.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.res.TypedArray; 6 | import android.util.AttributeSet; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.widget.ImageButton; 10 | import android.widget.RelativeLayout; 11 | import android.widget.TextView; 12 | 13 | import eclass.dogking.com.oneclass.R; 14 | 15 | public class TopBar extends RelativeLayout { 16 | 17 | public TopBar(Context context, AttributeSet attrs){ 18 | super(context,attrs); 19 | LayoutInflater.from(context).inflate(R.layout.title,this); 20 | 21 | ImageButton leftButton=(ImageButton) findViewById(R.id.title_back); 22 | TextView titleTextView = (TextView) findViewById(R.id.title_text); 23 | leftButton.setOnClickListener(new OnClickListener(){ 24 | public void onClick(View v){ 25 | ((Activity) getContext()).finish(); 26 | 27 | } 28 | 29 | }); 30 | 31 | TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TopBar); 32 | 33 | String titleText = typedArray.getString(R.styleable.TopBar_titleText); 34 | typedArray.recycle(); 35 | titleTextView.setText(titleText); 36 | 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/WelcomeActivity.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | import java.util.Timer; 8 | import java.util.TimerTask; 9 | 10 | /** 11 | * Created by dog on 2018/1/5 0005. 12 | */ 13 | 14 | public class WelcomeActivity extends AppCompatActivity{ 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.welcome); 18 | final Intent it = new Intent(this, LoginActivity.class); 19 | Timer timer = new Timer(); 20 | TimerTask task = new TimerTask() { 21 | @Override 22 | public void run() { 23 | startActivity(it); //执行意图 24 | WelcomeActivity.this.finish(); 25 | } 26 | }; 27 | timer.schedule(task, 1000 * 3); //3秒后跳转,这里根据自己需要设定时间 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Course.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/13 0013. 9 | */ 10 | 11 | public class Course implements Serializable { 12 | @SerializedName("name") 13 | private String name; 14 | @SerializedName("time") 15 | private String time; 16 | @SerializedName("detail") 17 | private String detail; 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public String getTime() { 28 | return time; 29 | } 30 | 31 | public void setTime(String time) { 32 | this.time = time; 33 | } 34 | 35 | public String getDetail() { 36 | return detail; 37 | } 38 | 39 | public void setDetail(String detail) { 40 | this.detail = detail; 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Exam.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/24 0024. 9 | */ 10 | public class Exam implements Serializable { 11 | @SerializedName("id") 12 | int id; 13 | @SerializedName("lid") 14 | int lid; 15 | @SerializedName("name") 16 | String name; 17 | @SerializedName("description") 18 | String description; 19 | @SerializedName("answer") 20 | String answer; 21 | @SerializedName("url") 22 | String url; 23 | 24 | public int getId() { 25 | return id; 26 | } 27 | 28 | public void setId(int id) { 29 | this.id = id; 30 | } 31 | 32 | public void setLid(int lid) { 33 | this.lid = lid; 34 | } 35 | 36 | public int getLid() { 37 | return lid; 38 | } 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | public String getDescription() { 49 | return description; 50 | } 51 | 52 | public void setDescription(String description) { 53 | this.description = description; 54 | } 55 | 56 | public void setAnswer(String answer) { 57 | this.answer = answer; 58 | } 59 | 60 | public String getAnswer() { 61 | return answer; 62 | } 63 | 64 | public void setUrl(String url) { 65 | this.url = url; 66 | } 67 | 68 | public String getUrl() { 69 | return url; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Exercise.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/10 0010. 9 | */ 10 | 11 | public class Exercise implements Serializable { 12 | @SerializedName("id") 13 | int id; 14 | @SerializedName("lid") 15 | int lid; 16 | @SerializedName("description") 17 | String description; 18 | @SerializedName("name") 19 | String name; 20 | @SerializedName("type") 21 | String type; 22 | @SerializedName("answer") 23 | String answer; 24 | 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public void setLid(int lid) { 34 | this.lid = lid; 35 | } 36 | 37 | public int getLid() { 38 | return lid; 39 | } 40 | 41 | public String getDescription() { 42 | return description; 43 | } 44 | 45 | public void setDescription(String description) { 46 | this.description = description; 47 | } 48 | 49 | public String getName() { 50 | return name; 51 | } 52 | 53 | public void setName(String name) { 54 | this.name = name; 55 | } 56 | 57 | public void setType(String type) { 58 | this.type = type; 59 | } 60 | 61 | public String getType() { 62 | return type; 63 | } 64 | 65 | public String getAnswer() { 66 | return answer; 67 | } 68 | 69 | public void setAnswer(String answer) { 70 | this.answer = answer; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/ExerciseShow.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/3/10 0010. 9 | */ 10 | public class ExerciseShow implements Serializable { 11 | @SerializedName("name") 12 | String name; 13 | @SerializedName("number") 14 | String number; 15 | @SerializedName("id") 16 | int id; 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public String getNumber() { 35 | return number; 36 | } 37 | 38 | public void setNumber(String number) { 39 | this.number = number; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/HttpDefault.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | /** 4 | * Created by dog on 2018/1/17 0017. 5 | */ 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Created by weij on 2017/12/24. 12 | */ 13 | 14 | public class HttpDefault { 15 | 16 | 17 | @SerializedName("error_code") 18 | private int error_code; 19 | @SerializedName("message") 20 | private String message; 21 | @SerializedName("data") 22 | private T data; 23 | 24 | public int getError_code() { 25 | return error_code; 26 | } 27 | 28 | public HttpDefault setError_code(int error_code) { 29 | this.error_code = error_code; 30 | return this; 31 | } 32 | 33 | public String getMessage() { 34 | return message; 35 | } 36 | 37 | public HttpDefault setMessage(String message) { 38 | this.message = message; 39 | return this; 40 | } 41 | 42 | public T getData() { 43 | return data; 44 | } 45 | 46 | public HttpDefault setData(T data) { 47 | this.data = data; 48 | return this; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "HttpDefault{" + 54 | "error_code=" + error_code + 55 | ", message='" + message + '\'' + 56 | ", data=" + data + 57 | '}'; 58 | } 59 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Lecture.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/1/30 0030. 9 | */ 10 | 11 | public class Lecture implements Serializable { 12 | 13 | @SerializedName("id") 14 | private int id; 15 | @SerializedName("name") 16 | private String name; 17 | @SerializedName("tid") 18 | private int tid; 19 | @SerializedName("pictureurl") 20 | private String pictureurl; 21 | @SerializedName("time") 22 | private String time; 23 | @SerializedName("type") 24 | private String type; 25 | @SerializedName("description") 26 | private String description; 27 | @SerializedName("detail") 28 | private String detail; 29 | @SerializedName("environment") 30 | private String environment; 31 | 32 | public int getId() { 33 | return id; 34 | } 35 | 36 | public void setId(int id) { 37 | this.id = id; 38 | } 39 | 40 | public String getName(){ 41 | return name; 42 | } 43 | 44 | public void setName(String name){ 45 | this.name=name; 46 | } 47 | 48 | public int getTid() { 49 | return tid; 50 | } 51 | 52 | public void setTid(int tid) { 53 | this.tid = tid; 54 | } 55 | 56 | public String getPictureurl(){ 57 | return pictureurl; 58 | } 59 | 60 | public void setPictureurl(String pictureurl){ 61 | this.pictureurl=pictureurl; 62 | } 63 | 64 | public String getTime(){ 65 | return time; 66 | } 67 | 68 | public void setTime(String time){ 69 | this.time=time; 70 | } 71 | 72 | public String getType(){ 73 | return type; 74 | } 75 | 76 | public void setType(String type){ 77 | this.type=type; 78 | } 79 | 80 | public String getDescription(){ 81 | return description; 82 | } 83 | 84 | public void setDescription(String description){ 85 | this.description=description; 86 | } 87 | 88 | public String getDetail(){ 89 | return detail; 90 | } 91 | 92 | public void setDetail(String detail){ 93 | this.detail=detail; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/LectureShow.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | 8 | /** 9 | * Created by dog on 2018/1/31 0031. 10 | */ 11 | 12 | public class LectureShow implements Serializable { 13 | @SerializedName("lectureName") 14 | private String lectureName; 15 | @SerializedName("teacherName") 16 | private String teacherName; 17 | @SerializedName("pictureUrl") 18 | private String pictureUrl; 19 | @SerializedName("type") 20 | private String type; 21 | 22 | public String getLectureName() { 23 | return lectureName; 24 | } 25 | 26 | public void setLectureName(String lectureName) { 27 | this.lectureName = lectureName; 28 | } 29 | 30 | public String getPictureUrl() { 31 | return pictureUrl; 32 | } 33 | 34 | public void setLectureUrl(String pictureUrl) { 35 | this.pictureUrl = pictureUrl; 36 | } 37 | 38 | public void setTeacherName(String teacherName) { 39 | this.teacherName = teacherName; 40 | } 41 | 42 | public String getTeacherName() { 43 | return teacherName; 44 | } 45 | 46 | public String getType() { 47 | return type; 48 | } 49 | 50 | public void setType(String type) { 51 | this.type = type; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Lecturecs.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/6 0006. 9 | */ 10 | 11 | public class Lecturecs implements Serializable { 12 | @SerializedName("id") 13 | private int id; 14 | @SerializedName("lid") 15 | private int lid; 16 | @SerializedName("sid") 17 | private int sid; 18 | @SerializedName("time") 19 | private String time; 20 | @SerializedName("exercise") 21 | private String exercise; 22 | @SerializedName("exam") 23 | private String exam; 24 | @SerializedName("score") 25 | private int score; 26 | 27 | public void setId(int id) { 28 | this.id = id; 29 | } 30 | 31 | public int getId() { 32 | return id; 33 | } 34 | 35 | public int getLid() { 36 | return lid; 37 | } 38 | 39 | public void setLid(int lid) { 40 | this.lid = lid; 41 | } 42 | 43 | public int getSid() { 44 | return sid; 45 | } 46 | 47 | public void setSid(int sid) { 48 | this.sid = sid; 49 | } 50 | 51 | public void setTime(String time) { 52 | this.time = time; 53 | } 54 | 55 | public String getTime() { 56 | return time; 57 | } 58 | 59 | public void setExercise(String exercise) { 60 | this.exercise = exercise; 61 | } 62 | 63 | public String getExercise() { 64 | return exercise; 65 | } 66 | 67 | public void setExam(String exam) { 68 | this.exam = exam; 69 | } 70 | 71 | public String getExam() { 72 | return exam; 73 | } 74 | 75 | public int getScore() { 76 | return score; 77 | } 78 | 79 | public void setScore(int score) { 80 | this.score = score; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Lectureson.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/15 0015. 9 | */ 10 | 11 | public class Lectureson implements Serializable { 12 | @SerializedName("id") 13 | private int id; 14 | @SerializedName("lid") 15 | private int lid; 16 | @SerializedName("head") 17 | private int head; 18 | @SerializedName("type") 19 | private int type; 20 | @SerializedName("name") 21 | private String name; 22 | @SerializedName("url") 23 | private String url; 24 | @SerializedName("description") 25 | private String description; 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | 31 | public void setId(int id) { 32 | this.id = id; 33 | } 34 | 35 | public int getLid() { 36 | return lid; 37 | } 38 | 39 | public void setLid(int lid) { 40 | this.lid = lid; 41 | } 42 | 43 | public int getHead() { 44 | return head; 45 | } 46 | 47 | public void setHead(int head) { 48 | this.head = head; 49 | } 50 | 51 | public String getName() { 52 | return name; 53 | } 54 | 55 | public void setName(String name) { 56 | this.name = name; 57 | } 58 | 59 | public void setType(int type) { 60 | this.type = type; 61 | } 62 | 63 | public void setDescription(String description) { 64 | this.description = description; 65 | } 66 | 67 | public String getDescription() { 68 | return description; 69 | } 70 | 71 | public int getType() { 72 | return type; 73 | } 74 | 75 | public String getUrl() { 76 | return url; 77 | } 78 | 79 | public void setUrl(String url) { 80 | this.url = url; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/MessageShow.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/21 0021. 9 | */ 10 | 11 | public class MessageShow implements Serializable { 12 | @SerializedName("id") 13 | int id; 14 | @SerializedName("headimg") 15 | String headimg; 16 | @SerializedName("name") 17 | String name; 18 | @SerializedName("description") 19 | String description; 20 | @SerializedName("message") 21 | String message; 22 | @SerializedName("time") 23 | String time; 24 | 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public String getHeadimg() { 34 | return headimg; 35 | } 36 | 37 | public void setHeadimg(String headimg) { 38 | this.headimg = headimg; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | 53 | public String getDescription() { 54 | return description; 55 | } 56 | 57 | public String getMessage() { 58 | return message; 59 | } 60 | 61 | public void setMessage(String message) { 62 | this.message = message; 63 | } 64 | 65 | public void setTime(String time) { 66 | this.time = time; 67 | } 68 | 69 | public String getTime() { 70 | return time; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/PptShow.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/25 0025. 9 | */ 10 | 11 | public class PptShow implements Serializable { 12 | @SerializedName("name") 13 | private String name; 14 | @SerializedName("filename") 15 | private String filename; 16 | @SerializedName("url") 17 | private String url; 18 | @SerializedName("id") 19 | private int id; 20 | 21 | 22 | public void setId(int id) { 23 | this.id = id; 24 | } 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | 38 | public void setUrl(String url) { 39 | this.url = url; 40 | } 41 | 42 | public String getUrl() { 43 | return url; 44 | } 45 | 46 | public String getFilename() { 47 | return filename; 48 | } 49 | 50 | public void setFilename(String filename) { 51 | this.filename = filename; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/Teacher.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/4 0004. 9 | */ 10 | 11 | 12 | public class Teacher implements Serializable { 13 | @SerializedName("id") 14 | private int id; 15 | @SerializedName("name") 16 | private String name; 17 | @SerializedName("sex") 18 | private String sex; 19 | @SerializedName("email") 20 | private String email; 21 | @SerializedName("school") 22 | private String school; 23 | @SerializedName("pictureurl") 24 | private String pictureurl; 25 | @SerializedName("description") 26 | private String description; 27 | @SerializedName("detail") 28 | private String detail; 29 | 30 | public Teacher(){} 31 | 32 | 33 | public int getId() { 34 | return id; 35 | } 36 | 37 | public void setId(int id) { 38 | this.id = id; 39 | } 40 | 41 | public String getName(){ 42 | return name; 43 | } 44 | 45 | public void setName(String name){ 46 | this.name=name; 47 | } 48 | 49 | public String getEmail() { 50 | return email; 51 | } 52 | 53 | public void setEmail(String email) { 54 | this.email = email; 55 | } 56 | 57 | public String getSchool() { 58 | return school; 59 | } 60 | 61 | public void setSchool(String school) { 62 | this.school = school; 63 | } 64 | 65 | public String getPictureurl(){ 66 | return pictureurl; 67 | } 68 | 69 | public void setPictureurl(String pictureurl){ 70 | this.pictureurl=pictureurl; 71 | } 72 | 73 | public String getSex() { 74 | return sex; 75 | } 76 | 77 | public void setSex(String sex) { 78 | this.sex = sex; 79 | } 80 | 81 | public String getDescription(){ 82 | return description; 83 | } 84 | 85 | public void setDescription(String description){ 86 | this.description=description; 87 | } 88 | 89 | public String getDetail(){ 90 | return detail; 91 | } 92 | 93 | public void setDetail(String detail){ 94 | this.detail=detail; 95 | } 96 | 97 | 98 | 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/User.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | /** 4 | * Created by dog on 2018/1/17 0017. 5 | */import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | 10 | public class User implements Serializable{ 11 | 12 | @SerializedName("id") 13 | private int id; 14 | @SerializedName("name") 15 | private String name; 16 | @SerializedName("password") 17 | private String password; 18 | @SerializedName("tel") 19 | private String tel; 20 | @SerializedName("headimg") 21 | private String headimg; 22 | @SerializedName("create_time") 23 | private String create_time; 24 | @SerializedName("updaie_time") 25 | private String update_time; 26 | @SerializedName("sex") 27 | private String sex; 28 | @SerializedName("description") 29 | private String description; 30 | 31 | public int getId() { 32 | return id; 33 | } 34 | public void setId(int Id) { 35 | this.id = Id; 36 | } 37 | 38 | public String getPassword() {return password;} 39 | public void setPassword(String Password) { 40 | this.password = Password; 41 | } 42 | 43 | public String getTel() { 44 | return tel; 45 | } 46 | public void setTel(String Tel) { 47 | this.tel = Tel; 48 | } 49 | 50 | public String getName() { 51 | return name; 52 | } 53 | public void setName(String Name) { 54 | this.name = Name; 55 | } 56 | 57 | public String getHeadimg() { 58 | return headimg; 59 | } 60 | public void setHeadimg(String Headimg) { 61 | this.headimg = Headimg; 62 | } 63 | 64 | public String getCreate_time() { 65 | return create_time; 66 | } 67 | 68 | public void setCreate_time(String create_time) { 69 | this.create_time = create_time; 70 | } 71 | 72 | public String getUpdate_time() { 73 | return update_time; 74 | } 75 | 76 | public void setUpdate_time(String update_time) { 77 | this.update_time = update_time; 78 | } 79 | public String getSex() { 80 | return sex; 81 | } 82 | 83 | public void setSex(String sex) { 84 | this.sex = sex; 85 | } 86 | public String getDescription() { 87 | return description; 88 | } 89 | 90 | public void setDescription(String description) { 91 | this.description = description; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/UserExercise.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/10 0010. 9 | */ 10 | 11 | public class UserExercise implements Serializable { 12 | @SerializedName("id") 13 | int id; 14 | @SerializedName("sid") 15 | int sid; 16 | @SerializedName("eid") 17 | int eid; 18 | @SerializedName("score") 19 | String score; 20 | @SerializedName("finish") 21 | String finish; 22 | 23 | public void setId(int id) { 24 | this.id = id; 25 | } 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | 31 | public void setSid(int sid) { 32 | this.sid = sid; 33 | } 34 | 35 | public int getSid() { 36 | return sid; 37 | } 38 | 39 | public int getEid() { 40 | return eid; 41 | } 42 | 43 | public void setEid(int eid) { 44 | this.eid = eid; 45 | } 46 | 47 | public String getScore() { 48 | return score; 49 | } 50 | 51 | public void setScore(String score) { 52 | this.score = score; 53 | } 54 | 55 | public String getFinish() { 56 | return finish; 57 | } 58 | 59 | public void setFinish(String finish) { 60 | this.finish = finish; 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/entiry/UserExerciseShow.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.entiry; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by dog on 2018/2/10 0010. 9 | */ 10 | 11 | public class UserExerciseShow implements Serializable { 12 | @SerializedName("name") 13 | String name; 14 | @SerializedName("finish") 15 | String finish; 16 | 17 | public void setName(String name) { 18 | this.name = name; 19 | } 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setFinish(String finish) { 26 | this.finish = finish; 27 | } 28 | 29 | public String getFinish() { 30 | return finish; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/CircleTransformation.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapShader; 6 | import android.graphics.Canvas; 7 | import android.graphics.Paint; 8 | 9 | import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; 10 | import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; 11 | 12 | /** 13 | * Created by dog on 2018/2/14 0014. 14 | */ 15 | 16 | public class CircleTransformation extends BitmapTransformation { 17 | public CircleTransformation(BitmapPool bitmapPool) { 18 | super(bitmapPool); 19 | } 20 | 21 | public CircleTransformation(Context context) { 22 | super(context); 23 | } 24 | 25 | @Override 26 | protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) { 27 | return circleCrop(pool, toTransform); 28 | } 29 | 30 | private Bitmap circleCrop(BitmapPool pool, Bitmap toTransform) { 31 | if (toTransform == null) return null; 32 | 33 | int size = Math.min(toTransform.getWidth(), toTransform.getHeight()); 34 | int x = (toTransform.getWidth() - size) / 2; 35 | int y = (toTransform.getHeight() - size) / 2; 36 | 37 | // TODO this could be acquired from the pool too 38 | Bitmap squared = Bitmap.createBitmap(toTransform, x, y, size, size); 39 | 40 | Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888); 41 | if (result == null) { 42 | result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); 43 | } 44 | 45 | Canvas canvas = new Canvas(result); 46 | Paint paint = new Paint(); 47 | paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP)); 48 | paint.setAntiAlias(true); 49 | float r = size / 2f; 50 | canvas.drawCircle(r, r, r, paint); 51 | return result; 52 | } 53 | 54 | @Override 55 | public String getId() { 56 | return getClass().getName(); 57 | } 58 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import android.os.Environment; 4 | 5 | import java.io.File; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.OutputStream; 10 | 11 | /** 12 | * Created by dog on 2018/2/22 0022. 13 | */ 14 | 15 | public class FileUtils { 16 | 17 | private String SDCardRoot; 18 | 19 | public FileUtils(){ 20 | //得到当前外部存储设备的目录 21 | SDCardRoot= Environment.getExternalStorageDirectory()+ File.separator; 22 | //File.separator为文件分隔符”/“,方便之后在目录下创建文件 23 | } 24 | 25 | //在SD卡上创建文件 26 | public File createFileInSDCard(String fileName,String dir) throws IOException { 27 | File file=new File(SDCardRoot+dir+File.separator+fileName); 28 | file.createNewFile(); 29 | return file; 30 | } 31 | 32 | //在SD卡上创建目录 33 | public File createSDDir(String dir)throws IOException{ 34 | File dirFile=new File(SDCardRoot+dir); 35 | dirFile.mkdir();//mkdir()只能创建一层文件目录,mkdirs()可以创建多层文件目录 36 | return dirFile; 37 | } 38 | 39 | //判断文件是否存在 40 | public boolean isFileExist(String fileName,String dir){ 41 | File file=new File(SDCardRoot+dir+File.separator+fileName); 42 | return file.exists(); 43 | } 44 | 45 | //将一个InoutStream里面的数据写入到SD卡中 46 | public File write2SDFromInput(String fileName,String dir,InputStream input){ 47 | File file=null; 48 | OutputStream output=null; 49 | try { 50 | //创建目录 51 | createSDDir(dir); 52 | //创建文件 53 | file=createFileInSDCard(fileName,dir); 54 | //写数据流 55 | output=new FileOutputStream(file); 56 | byte buffer[]=new byte[4*1024];//每次存4K 57 | int temp; 58 | //写入数据 59 | while((temp=input.read(buffer))!=-1){ 60 | output.write(buffer,0,temp); 61 | } 62 | output.flush(); 63 | } catch (Exception e) { 64 | System.out.println("写数据异常:"+e); 65 | } 66 | finally{ 67 | try { 68 | output.close(); 69 | } catch (Exception e2) { 70 | System.out.println(e2); 71 | } 72 | } 73 | return file; 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/GalleryfinalActionListener.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import java.util.List; 4 | 5 | import cn.finalteam.galleryfinal.model.PhotoInfo; 6 | 7 | /** 8 | * Created by dog on 2018/2/26 0026. 9 | */ 10 | 11 | public interface GalleryfinalActionListener { 12 | 13 | public void success(List list); 14 | public void failed(String msg); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/GildeImageLoader.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | /** 4 | * Created by dog on 2018/2/25 0025. 5 | */import android.app.Activity; 6 | import android.graphics.drawable.Drawable; 7 | 8 | import com.bumptech.glide.Glide; 9 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 10 | import com.bumptech.glide.load.resource.drawable.GlideDrawable; 11 | import com.bumptech.glide.request.Request; 12 | import com.bumptech.glide.request.target.ImageViewTarget; 13 | 14 | 15 | import cn.finalteam.galleryfinal.ImageLoader; 16 | import cn.finalteam.galleryfinal.widget.GFImageView; 17 | import eclass.dogking.com.oneclass.R; 18 | 19 | public class GildeImageLoader implements ImageLoader { 20 | 21 | @Override 22 | public void displayImage(Activity activity, String path, final GFImageView imageView, Drawable defaultDrawable, int width, int height) { 23 | Glide.with(activity) 24 | .load("file://" + path) 25 | .placeholder(defaultDrawable) 26 | .error(defaultDrawable) 27 | .override(width, height) 28 | .diskCacheStrategy(DiskCacheStrategy.NONE) //不缓存到SD卡 29 | .skipMemoryCache(true) 30 | //.centerCrop() 31 | .into(new ImageViewTarget(imageView) { 32 | @Override 33 | protected void setResource(GlideDrawable resource) { 34 | imageView.setImageDrawable(resource); 35 | } 36 | 37 | @Override 38 | public void setRequest(Request request) { 39 | imageView.setTag(R.id.adapter_item_tag_key,request); 40 | } 41 | 42 | @Override 43 | public Request getRequest() { 44 | return (Request) imageView.getTag(R.id.adapter_item_tag_key); 45 | } 46 | }); 47 | } 48 | 49 | 50 | @Override 51 | public void clearMemoryCache() { 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/HttpDownloader.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.File; 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.InputStreamReader; 8 | import java.net.HttpURLConnection; 9 | import java.net.URL; 10 | 11 | /** 12 | * Created by dog on 2018/2/22 0022. 13 | */ 14 | 15 | public class HttpDownloader { 16 | String line=null; 17 | StringBuffer strBuffer=new StringBuffer(); 18 | BufferedReader bufferReader=null; 19 | 20 | //下载小型的文档文件,返回文档的String字符串 21 | public String downloadFiles(String urlStr){ 22 | try { 23 | InputStream inputStream=getInputStreamFromUrl(urlStr); 24 | bufferReader=new BufferedReader(new InputStreamReader(inputStream)); 25 | while((line=bufferReader.readLine())!=null){ 26 | strBuffer.append(line+'\n'); 27 | } 28 | } catch (Exception e) { 29 | strBuffer.append("something is wrong!!"); 30 | System.out.println("读取数据异常:"+e); 31 | } finally{ 32 | try { 33 | bufferReader.close(); 34 | } catch (Exception e) { 35 | strBuffer.append("something is wrong!!"); 36 | e.printStackTrace(); 37 | } 38 | } 39 | return strBuffer.toString(); 40 | } 41 | 42 | //可以下载任意文件,例如MP3,并把文件存储在制定目录(-1:下载失败,0:下载成功,1:文件已存在) 43 | public int downloadFiles(String urlStr,String path,String fileName){ 44 | try { 45 | FileUtils fileUtils=new FileUtils(); 46 | if(fileUtils.isFileExist(fileName,path)) return 1;//判断文件是否存在 47 | else{ 48 | InputStream inputStream=getInputStreamFromUrl(urlStr); 49 | File resultFile=fileUtils.write2SDFromInput(fileName,path,inputStream); 50 | if(resultFile==null) return -1; 51 | } 52 | } catch (Exception e) { 53 | System.out.println("读写数据异常:"+e); 54 | return -1; 55 | } 56 | return 0; 57 | } 58 | 59 | public InputStream getInputStreamFromUrl(String urlStr)throws IOException { 60 | //创建一个URL对象 61 | URL url=new URL(urlStr); 62 | //创建一个HTTP链接 63 | HttpURLConnection urlConn=(HttpURLConnection)url.openConnection(); 64 | //使用IO流获取数据 65 | InputStream inputStream=urlConn.getInputStream(); 66 | return inputStream; 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/OneclassUtils.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import android.os.Environment; 4 | import android.util.Log; 5 | 6 | import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; 7 | 8 | import java.io.File; 9 | import java.util.concurrent.TimeUnit; 10 | 11 | import okhttp3.Cache; 12 | import okhttp3.OkHttpClient; 13 | import retrofit2.Retrofit; 14 | import retrofit2.converter.gson.GsonConverterFactory; 15 | 16 | /** 17 | * Created by dog on 2018/1/17 0017. 18 | */ 19 | 20 | public class OneclassUtils { 21 | private static Retrofit retrofit = null; 22 | private static OneclassUtils instance = null; 23 | private static OkHttpClient mOkHttpClient; 24 | private static Cache cache; 25 | 26 | //private static final String IP = "192.168.23.1";//学校 27 | private static final String IP = "172.16.162.71";//学校 28 | //private static final String IP = "192.168.0.101";//郦城 29 | //private static final String IP = "192.168.1.101";//怀德 30 | 31 | private static final String BASEURL = "http://" + IP + ":8080/"; 32 | 33 | 34 | public static String getBaseURL(){ 35 | return BASEURL; 36 | } 37 | 38 | static { 39 | initOkHttpClient(); 40 | 41 | } 42 | 43 | //初始化Retrofit 44 | public static T createAPI(Class cs) { 45 | 46 | if (retrofit == null) { 47 | retrofit = new Retrofit.Builder() 48 | .client(mOkHttpClient) 49 | .addConverterFactory(GsonConverterFactory.create()) 50 | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) 51 | .baseUrl(BASEURL) 52 | .build(); 53 | 54 | } 55 | return retrofit.create(cs); 56 | } 57 | private static void initOkHttpClient() { 58 | if (mOkHttpClient == null) { 59 | synchronized (OneclassUtils.class) { 60 | if (mOkHttpClient == null) { 61 | File cacheFile = new File(Environment.getDownloadCacheDirectory(), "HttpCache"); 62 | cache = new Cache(cacheFile, 1024 * 1024 * 20); 63 | mOkHttpClient = new OkHttpClient.Builder() 64 | .cache(cache) 65 | // .addNetworkInterceptor(new CacheInterceptor()) 66 | .retryOnConnectionFailure(true) 67 | .connectTimeout(10, TimeUnit.SECONDS) 68 | .writeTimeout(10, TimeUnit.SECONDS) 69 | .readTimeout(10, TimeUnit.SECONDS) 70 | .build(); 71 | Log.d("tag:", "initOkHttpClient成功: "); 72 | } 73 | } 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/choseDialog.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.os.Bundle; 6 | import android.util.DisplayMetrics; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.view.Window; 10 | import android.view.WindowManager; 11 | import android.widget.Button; 12 | import android.widget.EditText; 13 | 14 | import eclass.dogking.com.oneclass.R; 15 | 16 | /** 17 | * Created by dog on 2018/2/26 0026. 18 | */ 19 | 20 | public abstract class choseDialog extends Dialog implements View.OnClickListener{ 21 | 22 | private Activity activity; 23 | private Button b1; 24 | private Button b2; 25 | private Button b3; 26 | 27 | 28 | public choseDialog(Activity activity) { 29 | super(activity, R.style.dialog); 30 | this.activity = activity; 31 | } 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.dialogphoto); 37 | b1= (Button) findViewById(R.id.camer); 38 | b2= (Button) findViewById(R.id.photo); 39 | b3= (Button) findViewById(R.id.cancel); 40 | b1.setOnClickListener(this); 41 | b2.setOnClickListener(this); 42 | b3.setOnClickListener(this); 43 | 44 | setViewLocation(); 45 | setCanceledOnTouchOutside(true);//外部点击取消 46 | } 47 | 48 | /** 49 | * 设置dialog位于屏幕底部 50 | */ 51 | private void setViewLocation(){ 52 | DisplayMetrics dm = new DisplayMetrics(); 53 | activity.getWindowManager().getDefaultDisplay().getMetrics(dm); 54 | int height = dm.heightPixels; 55 | 56 | Window window = this.getWindow(); 57 | WindowManager.LayoutParams lp = window.getAttributes(); 58 | lp.x = 0; 59 | lp.y = height; 60 | lp.width = ViewGroup.LayoutParams.MATCH_PARENT; 61 | lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; 62 | // 设置显示位置 63 | onWindowAttributesChanged(lp); 64 | } 65 | 66 | @Override 67 | public void onClick(View v) { 68 | switch (v.getId()){ 69 | case R.id.camer: 70 | camer(); 71 | this.cancel(); 72 | break; 73 | case R.id.photo: 74 | photo(); 75 | this.cancel(); 76 | break; 77 | case R.id.cancel: 78 | this.cancel(); 79 | break; 80 | 81 | } 82 | } 83 | 84 | public abstract void camer(); 85 | 86 | public abstract void photo(); 87 | 88 | } -------------------------------------------------------------------------------- /app/src/main/java/eclass/dogking/com/oneclass/utils/messageDialog.java: -------------------------------------------------------------------------------- 1 | package eclass.dogking.com.oneclass.utils; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.os.Bundle; 7 | import android.support.v7.app.AlertDialog; 8 | import android.util.DisplayMetrics; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.view.Window; 12 | import android.view.WindowManager; 13 | import android.widget.Button; 14 | import android.widget.EditText; 15 | 16 | import eclass.dogking.com.oneclass.R; 17 | 18 | /** 19 | * Created by dog on 2018/2/21 0021. 20 | */ 21 | 22 | public abstract class messageDialog extends Dialog implements View.OnClickListener{ 23 | 24 | private Activity activity; 25 | private EditText editText; 26 | private Button btn; 27 | 28 | 29 | public messageDialog(Activity activity) { 30 | super(activity,R.style.dialog); 31 | this.activity = activity; 32 | } 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.dialog); 38 | editText=(EditText) findViewById(R.id.messedit); 39 | btn= (Button) findViewById(R.id.commit); 40 | btn.setOnClickListener(this); 41 | 42 | setViewLocation(); 43 | setCanceledOnTouchOutside(true);//外部点击取消 44 | } 45 | 46 | /** 47 | * 设置dialog位于屏幕底部 48 | */ 49 | private void setViewLocation(){ 50 | DisplayMetrics dm = new DisplayMetrics(); 51 | activity.getWindowManager().getDefaultDisplay().getMetrics(dm); 52 | int height = dm.heightPixels; 53 | 54 | Window window = this.getWindow(); 55 | WindowManager.LayoutParams lp = window.getAttributes(); 56 | lp.x = 0; 57 | lp.y = height; 58 | lp.width = ViewGroup.LayoutParams.MATCH_PARENT; 59 | lp.height = ViewGroup.LayoutParams.WRAP_CONTENT; 60 | // 设置显示位置 61 | onWindowAttributesChanged(lp); 62 | } 63 | public String gettext(){ 64 | return editText.getText().toString(); 65 | } 66 | 67 | @Override 68 | public void onClick(View v) { 69 | switch (v.getId()){ 70 | case R.id.commit: 71 | commit(); 72 | this.cancel(); 73 | break; 74 | } 75 | } 76 | 77 | public abstract void commit(); 78 | 79 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/push_bottom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_blue2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_blue3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_light_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_info_yellow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_table_last_colum.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/course_text_view_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_point_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_point_unselect.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_tab4_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 19 | 25 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_tab4_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 30 | 31 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_tab4_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 22 |