├── app ├── .gitignore ├── release │ ├── app-release.apk │ └── output.json ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ ├── drawable │ │ │ │ ├── about.png │ │ │ │ ├── admin.png │ │ │ │ ├── close.png │ │ │ │ ├── users.png │ │ │ │ ├── username.png │ │ │ │ ├── nonactive_dot.xml │ │ │ │ ├── active_dot.xml │ │ │ │ ├── imagebg.xml │ │ │ │ └── edit_text_style.xml │ │ │ ├── drawable-hdpi │ │ │ │ ├── menu.png │ │ │ │ ├── ic_pass.png │ │ │ │ ├── ic_user.png │ │ │ │ ├── ic_view.png │ │ │ │ ├── ic_logout.png │ │ │ │ ├── ic_upload.png │ │ │ │ ├── broderview.xml │ │ │ │ ├── broderviewmax.xml │ │ │ │ └── btn_style.xml │ │ │ ├── drawable-mdpi │ │ │ │ ├── down.png │ │ │ │ ├── ic_pass.png │ │ │ │ ├── ic_user.png │ │ │ │ ├── ic_view.png │ │ │ │ ├── loading.png │ │ │ │ ├── bdbanner.png │ │ │ │ ├── ic_logout.png │ │ │ │ ├── ic_upload.png │ │ │ │ ├── mainlogo.png │ │ │ │ ├── slid_one.png │ │ │ │ ├── slid_two.png │ │ │ │ ├── slid_three.png │ │ │ │ └── custom_spinner_background.xml │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_pass.png │ │ │ │ ├── ic_user.png │ │ │ │ ├── ic_view.png │ │ │ │ ├── ic_logout.png │ │ │ │ └── ic_upload.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_pass.png │ │ │ │ ├── ic_user.png │ │ │ │ ├── ic_view.png │ │ │ │ ├── ic_logout.png │ │ │ │ └── ic_upload.png │ │ │ ├── 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 │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── anim │ │ │ │ ├── downtoup.xml │ │ │ │ ├── uptodown.xml │ │ │ │ └── animation_fade_in.xml │ │ │ ├── layout │ │ │ │ ├── spinner_item.xml │ │ │ │ ├── custom_layout.xml │ │ │ │ ├── activity_admin_view.xml │ │ │ │ ├── activity_slash.xml │ │ │ │ ├── activity_admin.xml │ │ │ │ ├── activity_users.xml │ │ │ │ ├── activity_admin_profile.xml │ │ │ │ ├── activity_about.xml │ │ │ │ ├── image_item.xml │ │ │ │ ├── activity_upload.xml │ │ │ │ └── activity_main.xml │ │ │ └── menu │ │ │ │ └── main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── digitalclassroom15 │ │ │ │ └── digitalclassroom │ │ │ │ ├── navActivity │ │ │ │ ├── AboutActivity.java │ │ │ │ ├── UsersActivity.java │ │ │ │ └── AdminActivity.java │ │ │ │ ├── adapter │ │ │ │ ├── ViewPagerAdapter.java │ │ │ │ ├── UserAdapter.java │ │ │ │ └── ImageAdapter.java │ │ │ │ ├── SlashActivity.java │ │ │ │ ├── model │ │ │ │ └── Upload.java │ │ │ │ ├── adminPanel │ │ │ │ ├── AdminProfileActivity.java │ │ │ │ ├── AdminViewActivity.java │ │ │ │ └── UploadActivity.java │ │ │ │ ├── userSession │ │ │ │ ├── UserSessionManager.java │ │ │ │ └── UserSessionManager2.java │ │ │ │ ├── userPanel │ │ │ │ └── UserViewActivity.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── digitalclassroom15 │ │ │ └── digitalclassroom │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── digitalclassroom15 │ │ └── digitalclassroom │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── google-services.json └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .idea ├── modules.xml ├── gradle.xml ├── runConfigurations.xml ├── codeStyles │ └── Project.xml └── misc.xml ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/release/app-release.apk -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Digital Classroom 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable/about.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable/admin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable/close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable/users.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/username.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable/username.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/ic_pass.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/ic_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/ic_view.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/ic_pass.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/ic_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/ic_view.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/ic_logout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-hdpi/ic_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/bdbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/bdbanner.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/ic_logout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/ic_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/mainlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/mainlogo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/slid_one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/slid_one.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/slid_two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/slid_two.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xhdpi/ic_pass.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xhdpi/ic_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xhdpi/ic_view.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xxhdpi/ic_pass.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xxhdpi/ic_user.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xxhdpi/ic_view.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/slid_three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-mdpi/slid_three.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xhdpi/ic_logout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xhdpi/ic_upload.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xxhdpi/ic_logout.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/drawable-xxhdpi/ic_upload.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhasancse15/DigitalClassroom/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2},"path":"app-release.apk","properties":{"packageId":"com.digitalclassroom15.digitalclassroom","split":"","minSdkVersion":"18"}}] -------------------------------------------------------------------------------- /app/src/main/res/anim/downtoup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/anim/uptodown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/anim/animation_fade_in.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat May 12 20:51:24 BDT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/spinner_item.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/nonactive_dot.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/active_dot.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/custom_spinner_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/imagebg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/broderview.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 14 | -------------------------------------------------------------------------------- /app/src/test/java/com/digitalclassroom15/digitalclassroom/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_text_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/broderviewmax.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/btn_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 13 | 22 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/custom_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #607D8B 4 | #455A64 5 | #FF5E5F 6 | 7 | 8 | #fbffffff 9 | #000000 10 | #3D454B 11 | #EEEEEE 12 | 13 | 14 | #E0E0E0 15 | #a30100 16 | #fe5600 17 | #a30100 18 | 19 | 20 | #F8B551 21 | #4BCA88 22 | #58D7DF 23 | #FF5E5F 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_admin_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/navActivity/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.navActivity; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | import com.digitalclassroom15.digitalclassroom.R; 7 | 8 | public class AboutActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_about); 14 | 15 | 16 | getSupportActionBar().setTitle("About Us"); 17 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 18 | } 19 | 20 | // Back Button Work 21 | @Override 22 | public boolean onSupportNavigateUp() { 23 | finish(); 24 | return true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/digitalclassroom15/digitalclassroom/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.digitalclassroom15.digitalclassroom", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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 C:\Users\mahmu\AppData\Local\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/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "543180076621", 4 | "firebase_url": "https://digitalclassroom-7220b.firebaseio.com", 5 | "project_id": "digitalclassroom-7220b", 6 | "storage_bucket": "digitalclassroom-7220b.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:543180076621:android:0e06649ffadb7dac", 12 | "android_client_info": { 13 | "package_name": "com.digitalclassroom15.digitalclassroom" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "543180076621-ibojn54jkgrpi8sfpfv5j9pioklek4pb.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.digitalclassroom15.digitalclassroom", 22 | "certificate_hash": "17e7c39730b52ee1d1a2acd46bc0d3c3c1c32b3e" 23 | } 24 | }, 25 | { 26 | "client_id": "543180076621-2ipp02q4huq9a9hjf33grnqf3klisivk.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyBYxwWK9ICEkv72jyu5Fhdk0gxBtfRfOBU" 33 | } 34 | ], 35 | "services": { 36 | "analytics_service": { 37 | "status": 1 38 | }, 39 | "appinvite_service": { 40 | "status": 2, 41 | "other_platform_oauth_client": [ 42 | { 43 | "client_id": "543180076621-2ipp02q4huq9a9hjf33grnqf3klisivk.apps.googleusercontent.com", 44 | "client_type": 3 45 | } 46 | ] 47 | }, 48 | "ads_service": { 49 | "status": 2 50 | } 51 | } 52 | } 53 | ], 54 | "configuration_version": "1" 55 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 29 | 32 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | multiDexEnabled true 7 | applicationId "com.digitalclassroom15.digitalclassroom" 8 | minSdkVersion 18 9 | targetSdkVersion 27 10 | versionCode 2 11 | versionName "2" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | 28 | //noinspection GradleCompatible,GradleDynamicVersion 29 | implementation 'com.android.support:appcompat-v7:27.1.1' 30 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 31 | implementation 'com.android.support:cardview-v7:27.1.1' 32 | implementation 'com.android.support:design:27.1.1' 33 | implementation 'com.android.support:recyclerview-v7:27.1.1' 34 | implementation 'com.android.support:support-v4:27.1.1' 35 | implementation 'com.android.support:multidex:1.0.0' 36 | implementation 'de.hdodenhof:circleimageview:1.3.0' 37 | implementation 'com.squareup.picasso:picasso:2.5.2' 38 | implementation 'com.google.firebase:firebase-database:10.0.1' 39 | implementation 'com.google.firebase:firebase-storage:10.0.1' 40 | implementation 'com.google.firebase:firebase-auth:10.0.1' 41 | implementation 'com.google.firebase:firebase-core:10.0.1' 42 | testImplementation 'junit:junit:4.12' 43 | } 44 | 45 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_slash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 15 | 16 | 17 | 18 | 25 | 26 | 32 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/adapter/ViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.PagerAdapter; 5 | import android.support.v4.view.ViewPager; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | 11 | import com.digitalclassroom15.digitalclassroom.R; 12 | 13 | 14 | public class ViewPagerAdapter extends PagerAdapter { 15 | 16 | private Context context; 17 | private LayoutInflater layoutInflater; 18 | private Integer[] images = {R.drawable.slid_three, R.drawable.slid_two, R.drawable.slid_three}; 19 | 20 | public ViewPagerAdapter(Context context) { 21 | this.context = context; 22 | } 23 | 24 | @Override 25 | public int getCount() { 26 | return images.length; 27 | } 28 | 29 | @Override 30 | public boolean isViewFromObject(View view, Object object) { 31 | return view == object; 32 | } 33 | 34 | @Override 35 | public Object instantiateItem(ViewGroup container, final int position) { 36 | 37 | layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 38 | View view = layoutInflater.inflate(R.layout.custom_layout, null); 39 | ImageView imageView = view.findViewById(R.id.imageView); 40 | imageView.setImageResource(images[position]); 41 | 42 | view.setOnClickListener(new View.OnClickListener() { 43 | @Override 44 | public void onClick(View v) { 45 | 46 | if (position == 0) { 47 | /*Toast.makeText(context, "Slide 1 Clicked", Toast.LENGTH_SHORT).show();*/ 48 | } else if (position == 1) { 49 | /* Toast.makeText(context, "Slide 2 Clicked", Toast.LENGTH_SHORT).show();*/ 50 | } else { 51 | /* Toast.makeText(context, "Slide 3 Clicked", Toast.LENGTH_SHORT).show();*/ 52 | } 53 | 54 | } 55 | }); 56 | 57 | ViewPager vp = (ViewPager) container; 58 | vp.addView(view, 0); 59 | return view; 60 | 61 | } 62 | 63 | @Override 64 | public void destroyItem(ViewGroup container, int position, Object object) { 65 | 66 | ViewPager vp = (ViewPager) container; 67 | View view = (View) object; 68 | vp.removeView(view); 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/SlashActivity.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.view.WindowManager; 9 | import android.view.animation.Animation; 10 | import android.view.animation.AnimationUtils; 11 | import android.widget.LinearLayout; 12 | 13 | public class SlashActivity extends Activity implements Animation.AnimationListener { 14 | Animation animFadeIn; 15 | LinearLayout linearLayout; 16 | 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_slash); 21 | 22 | if (Build.VERSION.SDK_INT < 16) { 23 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 24 | WindowManager.LayoutParams.FLAG_FULLSCREEN); 25 | 26 | } else { 27 | View decorView = getWindow().getDecorView(); 28 | // Hide the status bar. 29 | int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; 30 | decorView.setSystemUiVisibility(uiOptions); 31 | // Remember that you should never show the action bar if the 32 | // status bar is hidden, so hide that too if necessary. 33 | } 34 | // load the animation 35 | animFadeIn = AnimationUtils.loadAnimation(getApplicationContext(), 36 | R.anim.animation_fade_in); 37 | // set animation listener 38 | animFadeIn.setAnimationListener(this); 39 | // animation for image 40 | linearLayout = (LinearLayout) findViewById(R.id.layout_linear); 41 | // start the animation 42 | linearLayout.setVisibility(View.VISIBLE); 43 | linearLayout.startAnimation(animFadeIn); 44 | 45 | } 46 | 47 | @Override 48 | public void onBackPressed() { 49 | this.finish(); 50 | super.onBackPressed(); 51 | } 52 | 53 | @Override 54 | public void onAnimationStart(Animation animation) { 55 | //under Implementation 56 | } 57 | 58 | public void onAnimationEnd(Animation animation) { 59 | // Start Main Screen 60 | Intent i = new Intent(SlashActivity.this, MainActivity.class); 61 | startActivity(i); 62 | this.finish(); 63 | } 64 | 65 | @Override 66 | public void onAnimationRepeat(Animation animation) { 67 | //under Implementation 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/model/Upload.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.model; 2 | 3 | import com.google.firebase.database.Exclude; 4 | 5 | /** 6 | * Created by mahmu on 3/5/2018. 7 | */ 8 | 9 | public class Upload { 10 | private String mtitle; 11 | private String mImageUrl; 12 | private String className; 13 | private String subjectName; 14 | private String lastDate; 15 | private String sectionName; 16 | private String key; 17 | 18 | public Upload() { 19 | //empty constructor needed 20 | } 21 | 22 | public Upload(String title, String imageUrl) { 23 | if (title.trim().equals("")) { 24 | title = "No Title"; 25 | } 26 | 27 | mtitle = title; 28 | mImageUrl = imageUrl; 29 | } 30 | 31 | public Upload(String className, String title, String imageUrl) { 32 | 33 | if (title.trim().equals("")) { 34 | title = "No Title"; 35 | } 36 | this.mtitle = title; 37 | this.mImageUrl = imageUrl; 38 | this.className = className; 39 | } 40 | 41 | public Upload(String className, String sectionName, String subjectName, String mtitle, String mImageUrl, String lastDate) { 42 | 43 | if (mtitle.trim().equals("")) { 44 | mtitle = "Null"; 45 | } 46 | if (className.trim().equals("")) { 47 | className = "Null"; 48 | } 49 | 50 | this.className = className; 51 | this.sectionName = sectionName; 52 | this.subjectName = subjectName; 53 | this.mtitle = mtitle; 54 | this.mImageUrl = mImageUrl; 55 | this.lastDate = lastDate; 56 | } 57 | 58 | public String getName() { 59 | return mtitle; 60 | } 61 | 62 | public void setName(String title) { 63 | mtitle = title; 64 | } 65 | 66 | public String getImageUrl() { 67 | return mImageUrl; 68 | } 69 | 70 | public void setImageUrl(String imageUrl) { 71 | mImageUrl = imageUrl; 72 | } 73 | 74 | 75 | public String getClassName() { 76 | return className; 77 | } 78 | 79 | public void setClassName(String className) { 80 | this.className = className; 81 | } 82 | 83 | public String getSubjectName() { 84 | return subjectName; 85 | } 86 | 87 | public void setSubjectName(String subjectName) { 88 | this.subjectName = subjectName; 89 | } 90 | 91 | public String getLastDate() { 92 | return lastDate; 93 | } 94 | 95 | public void setLastDate(String lastDate) { 96 | this.lastDate = lastDate; 97 | } 98 | 99 | public String getSectionName() { 100 | return sectionName; 101 | } 102 | 103 | public void setSectionName(String sectionName) { 104 | this.sectionName = sectionName; 105 | } 106 | 107 | 108 | @Exclude 109 | public String getMkey() { 110 | return key; 111 | } 112 | 113 | @Exclude 114 | public void setMkey(String key) { 115 | this.key = key; 116 | } 117 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/adminPanel/AdminProfileActivity.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.adminPanel; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.widget.Button; 8 | 9 | import com.digitalclassroom15.digitalclassroom.R; 10 | import com.digitalclassroom15.digitalclassroom.userSession.UserSessionManager; 11 | 12 | public class AdminProfileActivity extends AppCompatActivity { 13 | 14 | // User Session Manager Class 15 | UserSessionManager session; 16 | // Button Logout 17 | Button btnLogout; 18 | 19 | @Override 20 | public void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.activity_admin_profile); 23 | 24 | // Get Type user name 25 | getSupportActionBar().setTitle("Admin Panel"); 26 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 27 | 28 | // Session class instance 29 | session = new UserSessionManager(getApplicationContext()); 30 | /* 31 | TextView lblName = (TextView) findViewById(R.id.lblName); 32 | TextView lblEmail = (TextView) findViewById(R.id.lblEmail);*/ 33 | 34 | // Button logout 35 | btnLogout = (Button) findViewById(R.id.logoutBtn); 36 | 37 | // Toast.makeText(getApplicationContext(),"User Login Status: " + session.isUserLoggedIn(), Toast.LENGTH_LONG).show(); 38 | 39 | // Check user login (this is the important point) 40 | // If User is not logged in , This will redirect user to AdminActivity 41 | // and finish current activity from activity stack. 42 | if(session.checkLogin()) 43 | finish(); 44 | 45 | /* // get user data from session 46 | HashMap user = session.getUserDetails(); 47 | 48 | // get name 49 | String name = user.get(UserSessionManager.KEY_NAME); 50 | 51 | // get email 52 | String email = user.get(UserSessionManager.KEY_EMAIL); 53 | 54 | // Show user data on activity 55 | lblName.setText(Html.fromHtml("Name: " + name + "")); 56 | lblEmail.setText(Html.fromHtml("Email: " + email + ""));*/ 57 | 58 | btnLogout.setOnClickListener(new View.OnClickListener() { 59 | 60 | @Override 61 | public void onClick(View arg0) { 62 | 63 | // Clear the User session data 64 | // and redirect user to AdminActivity 65 | session.logoutUser(); 66 | finish(); 67 | } 68 | }); 69 | } 70 | 71 | public void goToUpload(View view) { 72 | Intent i=new Intent(AdminProfileActivity.this,UploadActivity.class); 73 | startActivity(i); 74 | } 75 | 76 | public void goToView(View view) { 77 | Intent i=new Intent(AdminProfileActivity.this,AdminViewActivity.class); 78 | startActivity(i); 79 | } 80 | 81 | // Back Button Work 82 | @Override 83 | public boolean onSupportNavigateUp() { 84 | finish(); 85 | return true; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/navActivity/UsersActivity.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.navActivity; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import com.digitalclassroom15.digitalclassroom.R; 12 | import com.digitalclassroom15.digitalclassroom.userPanel.UserViewActivity; 13 | import com.digitalclassroom15.digitalclassroom.userSession.UserSessionManager2; 14 | 15 | public class UsersActivity extends AppCompatActivity { 16 | Button btnLogin; 17 | 18 | EditText txtUsername, txtPassword; 19 | 20 | // User Session Manager Class 21 | UserSessionManager2 session; 22 | 23 | @Override 24 | public void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_users); 27 | 28 | 29 | getSupportActionBar().setTitle("Users Login"); 30 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 31 | 32 | 33 | // User Session Manager 34 | session = new UserSessionManager2(getApplicationContext()); 35 | 36 | // get Email, Password input text 37 | txtUsername = (EditText) findViewById(R.id.userNameET); 38 | txtPassword = (EditText) findViewById(R.id.passwordET); 39 | 40 | // Toast.makeText(getApplicationContext(), "User Login Status: " + session.isUserLoggedIn(), Toast.LENGTH_LONG).show(); 41 | 42 | 43 | // User Login button 44 | btnLogin = (Button) findViewById(R.id.loginBtn); 45 | 46 | 47 | // Login button click event 48 | btnLogin.setOnClickListener(new View.OnClickListener() { 49 | 50 | @Override 51 | public void onClick(View arg0) { 52 | 53 | // Get username, password from EditText 54 | String username = txtUsername.getText().toString(); 55 | String password = txtPassword.getText().toString(); 56 | 57 | // Validate if username, password is filled 58 | if (username.trim().length() > 0 && password.trim().length() > 0) { 59 | 60 | // For testing puspose username, password is checked with static data 61 | // username = admin 62 | // password = admin 63 | 64 | if (username.equals("user") && password.equals("user")) { 65 | 66 | // Creating user login session 67 | // Statically storing name="Android Example" 68 | // and email="androidexample84@gmail.com" 69 | session.createUserLoginSession("Developed By:", 70 | "Md. Mahmudul Hasan"); 71 | 72 | // Starting AdminProfileActivity 73 | Intent i = new Intent(getApplicationContext(), UserViewActivity.class); 74 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 75 | 76 | // Add new Flag to start new Activity 77 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 78 | startActivity(i); 79 | 80 | finish(); 81 | 82 | } else { 83 | 84 | // username / password doesn't match& 85 | Toast.makeText(getApplicationContext(), 86 | "Username/Password is incorrect", 87 | Toast.LENGTH_LONG).show(); 88 | 89 | } 90 | } else { 91 | 92 | // user didn't entered username or password 93 | Toast.makeText(getApplicationContext(), 94 | "Please enter username and password", 95 | Toast.LENGTH_LONG).show(); 96 | 97 | } 98 | 99 | } 100 | }); 101 | } 102 | 103 | // Back Button Work 104 | @Override 105 | public boolean onSupportNavigateUp() { 106 | finish(); 107 | return true; 108 | } 109 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/navActivity/AdminActivity.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.navActivity; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | import android.widget.Button; 8 | import android.widget.EditText; 9 | import android.widget.Toast; 10 | 11 | import com.digitalclassroom15.digitalclassroom.R; 12 | import com.digitalclassroom15.digitalclassroom.adminPanel.AdminProfileActivity; 13 | import com.digitalclassroom15.digitalclassroom.userSession.UserSessionManager; 14 | 15 | public class AdminActivity extends AppCompatActivity { 16 | Button btnLogin; 17 | 18 | EditText txtUsername, txtPassword; 19 | 20 | // User Session Manager Class 21 | UserSessionManager session; 22 | 23 | @Override 24 | public void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_admin); 27 | 28 | 29 | getSupportActionBar().setTitle("Admin Login"); 30 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 31 | 32 | 33 | // User Session Manager 34 | session = new UserSessionManager(getApplicationContext()); 35 | 36 | // get Email, Password input text 37 | txtUsername = (EditText) findViewById(R.id.userNameET); 38 | txtPassword = (EditText) findViewById(R.id.passwordET); 39 | 40 | // Toast.makeText(getApplicationContext(), "User Login Status: " + session.isUserLoggedIn(), Toast.LENGTH_LONG).show(); 41 | 42 | 43 | // User Login button 44 | btnLogin = (Button) findViewById(R.id.loginBtn); 45 | 46 | 47 | // Login button click event 48 | btnLogin.setOnClickListener(new View.OnClickListener() { 49 | 50 | @Override 51 | public void onClick(View arg0) { 52 | 53 | // Get username, password from EditText 54 | String username = txtUsername.getText().toString(); 55 | String password = txtPassword.getText().toString(); 56 | 57 | // Validate if username, password is filled 58 | if (username.trim().length() > 0 && password.trim().length() > 0) { 59 | 60 | // For testing puspose username, password is checked with static data 61 | // username = admin 62 | // password = admin 63 | 64 | if (username.equals("digitaladmin") && password.equals("digital@2k18")) { 65 | 66 | // Creating user login session 67 | // Statically storing name="Android Example" 68 | // and email="androidexample84@gmail.com" 69 | session.createUserLoginSession("Developed By:", 70 | "Md. Mahmudul Hasan"); 71 | 72 | // Starting AdminProfileActivity 73 | Intent i = new Intent(getApplicationContext(), AdminProfileActivity.class); 74 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 75 | 76 | // Add new Flag to start new Activity 77 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 78 | startActivity(i); 79 | 80 | finish(); 81 | 82 | } else { 83 | 84 | // username / password doesn't match& 85 | Toast.makeText(getApplicationContext(), 86 | "Username/Password is incorrect", 87 | Toast.LENGTH_LONG).show(); 88 | 89 | } 90 | } else { 91 | 92 | // user didn't entered username or password 93 | Toast.makeText(getApplicationContext(), 94 | "Please enter username and password", 95 | Toast.LENGTH_LONG).show(); 96 | 97 | } 98 | 99 | } 100 | }); 101 | } 102 | 103 | // Back Button Work 104 | @Override 105 | public boolean onSupportNavigateUp() { 106 | finish(); 107 | return true; 108 | } 109 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/userSession/UserSessionManager.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.userSession; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | 7 | import com.digitalclassroom15.digitalclassroom.adminPanel.AdminProfileActivity; 8 | import com.digitalclassroom15.digitalclassroom.navActivity.AdminActivity; 9 | 10 | import java.util.HashMap; 11 | 12 | /** 13 | * Created by mahmu on 3/4/2018. 14 | */ 15 | 16 | public class UserSessionManager {// Shared Preferences reference 17 | SharedPreferences pref; 18 | 19 | // Editor reference for Shared preferences 20 | SharedPreferences.Editor editor; 21 | 22 | // Context 23 | Context _context; 24 | 25 | // Shared pref mode 26 | int PRIVATE_MODE = 0; 27 | 28 | // Sharedpref file name 29 | private static final String PREFER_NAME = "AndroidExamplePref"; 30 | 31 | // All Shared Preferences Keys 32 | private static final String IS_USER_LOGIN = "IsUserLoggedIn"; 33 | 34 | // User name (make variable public to access from outside) 35 | public static final String KEY_NAME = "name"; 36 | 37 | // Email address (make variable public to access from outside) 38 | public static final String KEY_EMAIL = "email"; 39 | 40 | // Constructor 41 | public UserSessionManager(Context context){ 42 | this._context = context; 43 | pref = _context.getSharedPreferences(PREFER_NAME, PRIVATE_MODE); 44 | editor = pref.edit(); 45 | } 46 | 47 | //Create login session 48 | public void createUserLoginSession(String name, String email){ 49 | // Storing login value as TRUE 50 | editor.putBoolean(IS_USER_LOGIN, true); 51 | 52 | // Storing name in pref 53 | editor.putString(KEY_NAME, name); 54 | 55 | // Storing email in pref 56 | editor.putString(KEY_EMAIL, email); 57 | 58 | // commit changes 59 | editor.commit(); 60 | } 61 | 62 | /** 63 | * Check login method will check user login status 64 | * If false it will redirect user to login page 65 | * Else do anything 66 | * */ 67 | public boolean checkLogin(){ 68 | // Check login status 69 | if(!this.isUserLoggedIn()){ 70 | 71 | // user is not logged in redirect him to Login Activity 72 | Intent i = new Intent(_context, AdminActivity.class); 73 | 74 | // Closing all the Activities from stack 75 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 76 | 77 | // Add new Flag to start new Activity 78 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 79 | 80 | // Staring Login Activity 81 | _context.startActivity(i); 82 | 83 | return true; 84 | } 85 | else{ 86 | // user is not logged in redirect him to Login Activity 87 | Intent i = new Intent(_context, AdminProfileActivity.class); 88 | 89 | } 90 | return false; 91 | } 92 | 93 | 94 | 95 | /** 96 | * Get stored session data 97 | * */ 98 | public HashMap getUserDetails(){ 99 | 100 | //Use hashmap to store user credentials 101 | HashMap user = new HashMap(); 102 | 103 | // user name 104 | user.put(KEY_NAME, pref.getString(KEY_NAME, null)); 105 | 106 | // user email id 107 | user.put(KEY_EMAIL, pref.getString(KEY_EMAIL, null)); 108 | 109 | // return user 110 | return user; 111 | } 112 | 113 | /** 114 | * Clear session details 115 | * */ 116 | public void logoutUser(){ 117 | 118 | // Clearing all user data from Shared Preferences 119 | editor.clear(); 120 | editor.commit(); 121 | 122 | // After logout redirect user to Login Activity 123 | Intent i = new Intent(_context, AdminActivity.class); 124 | 125 | // Closing all the Activities 126 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 127 | 128 | // Add new Flag to start new Activity 129 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 130 | 131 | // Staring Login Activity 132 | _context.startActivity(i); 133 | } 134 | 135 | 136 | // Check for login 137 | public boolean isUserLoggedIn(){ 138 | return pref.getBoolean(IS_USER_LOGIN, false); 139 | } 140 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/userSession/UserSessionManager2.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.userSession; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | 7 | import com.digitalclassroom15.digitalclassroom.adminPanel.AdminProfileActivity; 8 | import com.digitalclassroom15.digitalclassroom.navActivity.UsersActivity; 9 | 10 | import java.util.HashMap; 11 | 12 | /** 13 | * Created by mahmu on 3/4/2018. 14 | */ 15 | 16 | public class UserSessionManager2 { 17 | // Shared Preferences reference 18 | SharedPreferences pref; 19 | 20 | // Editor reference for Shared preferences 21 | SharedPreferences.Editor editor; 22 | 23 | // Context 24 | Context _context; 25 | 26 | // Shared pref mode 27 | int PRIVATE_MODE = 0; 28 | 29 | // Sharedpref file name 30 | private static final String PREFER_NAME = "AndroidExamplePref1"; 31 | 32 | // All Shared Preferences Keys 33 | private static final String IS_USER_LOGIN = "IsUserLoggedIn1"; 34 | 35 | // User name (make variable public to access from outside) 36 | public static final String KEY_USERNAME = "user_Name"; 37 | 38 | // Email address (make variable public to access from outside) 39 | public static final String KEY_USEREMAIL = "user_Email"; 40 | 41 | // Constructor 42 | public UserSessionManager2(Context context){ 43 | this._context = context; 44 | pref = _context.getSharedPreferences(PREFER_NAME, PRIVATE_MODE); 45 | editor = pref.edit(); 46 | } 47 | 48 | //Create login session 49 | public void createUserLoginSession(String user_name, String user_email){ 50 | // Storing login value as TRUE 51 | editor.putBoolean(IS_USER_LOGIN, true); 52 | 53 | // Storing name in pref 54 | editor.putString(KEY_USERNAME, user_name); 55 | 56 | // Storing email in pref 57 | editor.putString(KEY_USEREMAIL, user_email); 58 | 59 | // commit changes 60 | editor.commit(); 61 | } 62 | 63 | /** 64 | * Check login method will check user login status 65 | * If false it will redirect user to login page 66 | * Else do anything 67 | * */ 68 | public boolean checkLogin(){ 69 | // Check login status 70 | if(!this.isUserLoggedIn()){ 71 | 72 | // user is not logged in redirect him to Login Activity 73 | Intent i = new Intent(_context, UsersActivity.class); 74 | 75 | // Closing all the Activities from stack 76 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 77 | 78 | // Add new Flag to start new Activity 79 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 80 | 81 | // Staring Login Activity 82 | _context.startActivity(i); 83 | 84 | return true; 85 | } 86 | else{ 87 | // user is not logged in redirect him to Login Activity 88 | Intent i = new Intent(_context, AdminProfileActivity.class); 89 | 90 | } 91 | return false; 92 | } 93 | 94 | 95 | 96 | /** 97 | * Get stored session data 98 | * */ 99 | public HashMap getUserDetails(){ 100 | 101 | //Use hashmap to store user credentials 102 | HashMap user_name = new HashMap(); 103 | 104 | // user name 105 | user_name.put(KEY_USERNAME, pref.getString(KEY_USERNAME, null)); 106 | 107 | // user email id 108 | user_name.put(KEY_USEREMAIL, pref.getString(KEY_USEREMAIL, null)); 109 | 110 | // return user 111 | return user_name; 112 | } 113 | 114 | /** 115 | * Clear session details 116 | * */ 117 | public void logoutUser(){ 118 | 119 | // Clearing all user data from Shared Preferences 120 | editor.clear(); 121 | editor.commit(); 122 | 123 | // After logout redirect user to Login Activity 124 | Intent i = new Intent(_context, UsersActivity.class); 125 | 126 | // Closing all the Activities 127 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 128 | 129 | // Add new Flag to start new Activity 130 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 131 | 132 | // Staring Login Activity 133 | _context.startActivity(i); 134 | } 135 | 136 | 137 | // Check for login 138 | public boolean isUserLoggedIn(){ 139 | return pref.getBoolean(IS_USER_LOGIN, false); 140 | } 141 | } -------------------------------------------------------------------------------- /app/src/main/java/com/digitalclassroom15/digitalclassroom/adapter/UserAdapter.java: -------------------------------------------------------------------------------- 1 | package com.digitalclassroom15.digitalclassroom.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.ContextMenu; 6 | import android.view.LayoutInflater; 7 | import android.view.Menu; 8 | import android.view.MenuItem; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.ImageView; 12 | import android.widget.TextView; 13 | 14 | import com.digitalclassroom15.digitalclassroom.R; 15 | import com.digitalclassroom15.digitalclassroom.model.Upload; 16 | import com.squareup.picasso.Picasso; 17 | 18 | import java.util.List; 19 | 20 | 21 | public class UserAdapter extends RecyclerView.Adapter { 22 | private Context mContext; 23 | private List mUploads; 24 | private OnItemClickListener mListener; 25 | 26 | public UserAdapter(Context context, List uploads) { 27 | mContext = context; 28 | mUploads = uploads; 29 | } 30 | 31 | @Override 32 | public ImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 33 | View v = LayoutInflater.from(mContext).inflate(R.layout.image_item, parent, false); 34 | return new ImageViewHolder(v); 35 | } 36 | 37 | @Override 38 | public void onBindViewHolder(ImageViewHolder holder, int position) { 39 | Upload uploadCurrent = mUploads.get(position); 40 | holder.textViewName.setText(uploadCurrent.getName()); 41 | holder.textSection.setText(uploadCurrent.getSectionName()); 42 | holder.textClassName.setText(uploadCurrent.getClassName()); 43 | holder.textSubjectName.setText(uploadCurrent.getSubjectName()); 44 | holder.textsubdate.setText(uploadCurrent.getLastDate()); 45 | 46 | Picasso.with(mContext) 47 | .load(uploadCurrent.getImageUrl()) 48 | .fit() 49 | // .centerCrop() 50 | .into(holder.imageView); 51 | } 52 | 53 | @Override 54 | public int getItemCount() { 55 | return mUploads.size(); 56 | } 57 | 58 | public class ImageViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, 59 | View.OnCreateContextMenuListener, MenuItem.OnMenuItemClickListener { 60 | public TextView textViewName,textClassName,textSection,textSubjectName,textsubdate; 61 | public ImageView imageView; 62 | 63 | public ImageViewHolder(View itemView) { 64 | super(itemView); 65 | 66 | textViewName = itemView.findViewById(R.id.titleTV); 67 | imageView = itemView.findViewById(R.id.imageIV); 68 | textSection=itemView.findViewById(R.id.sectionNameTV); 69 | textClassName=itemView.findViewById(R.id.classNameTV); 70 | textSubjectName=itemView.findViewById(R.id.subjectNameTV); 71 | textsubdate=itemView.findViewById(R.id.lastDateTV); 72 | 73 | itemView.setOnClickListener(this); 74 | itemView.setOnCreateContextMenuListener(this); 75 | } 76 | 77 | @Override 78 | public void onClick(View v) { 79 | if (mListener != null) { 80 | int position = getAdapterPosition(); 81 | if (position != RecyclerView.NO_POSITION) { 82 | mListener.onItemClick(position); 83 | } 84 | } 85 | } 86 | 87 | @Override 88 | public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { 89 | menu.setHeaderTitle("Select Action"); 90 | MenuItem doWhatever = menu.add(Menu.NONE, 1, 1, "Download"); 91 | doWhatever.setOnMenuItemClickListener(this); 92 | } 93 | 94 | @Override 95 | public boolean onMenuItemClick(MenuItem item) { 96 | if (mListener != null) { 97 | int position = getAdapterPosition(); 98 | if (position != RecyclerView.NO_POSITION) { 99 | 100 | switch (item.getItemId()) { 101 | case 1: 102 | mListener.onWhatEverClick(position); 103 | return true; 104 | } 105 | } 106 | } 107 | return false; 108 | } 109 | } 110 | 111 | public interface OnItemClickListener { 112 | void onItemClick(int position); 113 | 114 | void onWhatEverClick(int position); 115 | } 116 | 117 | public void setOnItemClickListener(OnItemClickListener listener) { 118 | mListener = listener; 119 | } 120 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 23 | 24 | 36 | 37 | 44 | 45 | 46 | 51 | 52 | 64 | 65 | 77 | 78 | 79 |