-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HariharanEswaran
authored and
Hariharan
committed
Nov 15, 2021
1 parent
5afc178
commit 397ebf1
Showing
88 changed files
with
3,585 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apply plugin: 'com.android.application' | ||
android { | ||
compileSdkVersion 30 | ||
defaultConfig { | ||
applicationId "com.braver.tool.filepicker" | ||
minSdkVersion 23 | ||
targetSdkVersion 30 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'androidx.appcompat:appcompat:1.3.1' | ||
implementation 'com.google.android.material:material:1.4.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1' | ||
//implementation 'androidx.core:core:1.7.0' | ||
testImplementation 'junit:junit:4.+' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
implementation 'com.intuit.sdp:sdp-android:1.0.6' | ||
implementation 'com.google.android.exoplayer:exoplayer:2.15.0' | ||
implementation 'com.github.chrisbanes:PhotoView:2.3.0' | ||
implementation project(':picker') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
app/src/androidTest/java/com/braver/tool/filepicker/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.braver.tool.filepicker; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
assertEquals("com.braver.tool.filepicker", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.braver.tool.filepicker"> | ||
|
||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission | ||
android:name="android.permission.MANAGE_EXTERNAL_STORAGE" | ||
tools:ignore="ScopedStorage" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_app_logo" | ||
android:label="@string/app_name" | ||
android:requestLegacyExternalStorage="true" | ||
android:roundIcon="@mipmap/ic_app_logo" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.FilePicker"> | ||
<activity | ||
android:name=".LaunchActivity" | ||
android:exported="true" | ||
android:theme="@style/SplashTheme"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".PickerActivity" | ||
android:exported="true" /> | ||
<activity android:name="com.braver.tool.picker.CameraActivity" /> | ||
<activity android:name=".PreviewActivity" /> | ||
|
||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="${applicationId}.provider" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/provider_paths" | ||
tools:replace="android:resource" /> | ||
</provider> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/braver/tool/filepicker/CustomPreferencesManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.braver.tool.filepicker; | ||
|
||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
import android.os.Build; | ||
|
||
import static com.braver.tool.filepicker.PermissionUtils.IS_PERMISSION_DIALOG_ANDROID_11; | ||
|
||
public class CustomPreferencesManager { | ||
private static final String NOTIFICATION_PREFERENCES_NAME = "braver_preferences"; | ||
public final SharedPreferences notificationPrefManager; | ||
|
||
/** | ||
* Method used to initiate Notification User Defaults | ||
* | ||
* @param context - Current Activity | ||
*/ | ||
public CustomPreferencesManager(Context context) { | ||
Context storageContext; | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | ||
final Context deviceContext = context.createDeviceProtectedStorageContext(); | ||
if (!deviceContext.moveSharedPreferencesFrom(context, NOTIFICATION_PREFERENCES_NAME)) { | ||
AppUtils.printLogConsole("CustomPreferencesManager", "Failed to migrate shared preferences."); | ||
} | ||
storageContext = deviceContext; | ||
} else { | ||
storageContext = context; | ||
} | ||
notificationPrefManager = storageContext.getSharedPreferences(NOTIFICATION_PREFERENCES_NAME, Context.MODE_PRIVATE); | ||
} | ||
|
||
/** | ||
* Method used to get UserDefault | ||
*/ | ||
public String getPermissionDialogData() { | ||
String data = ""; | ||
if (notificationPrefManager != null) { | ||
data = notificationPrefManager.getString(IS_PERMISSION_DIALOG_ANDROID_11, ""); | ||
} | ||
return data; | ||
} | ||
|
||
/** | ||
* Method used to set UserDefault | ||
* | ||
* @param permissionType - String data | ||
*/ | ||
public void setPermissionDialogData(String permissionType) { | ||
if (notificationPrefManager != null) { | ||
SharedPreferences.Editor editor = notificationPrefManager.edit(); | ||
editor.putString(IS_PERMISSION_DIALOG_ANDROID_11, permissionType); | ||
editor.apply(); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/braver/tool/filepicker/LaunchActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.braver.tool.filepicker; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.Handler; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
public class LaunchActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_launch); | ||
new Handler().postDelayed(() -> { | ||
startActivity(new Intent(LaunchActivity.this, PickerActivity.class)); | ||
finish(); | ||
}, 800); | ||
} | ||
} |
Oops, something went wrong.