Skip to content

Commit

Permalink
Merge pull request #16 from rumaan/about-activity
Browse files Browse the repository at this point in the history
Added Licences activity
  • Loading branch information
rumaan authored Oct 4, 2018
2 parents e59dd87 + 3699f73 commit 37e1f07
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 206 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This app is made with the help of [file.io](https://file.io) which is an **_Anon
- [NumberProgressBar](https://github.com/daimajia/NumberProgressBar)
- [FirebaseCrashlytics](https://firebase.google.com/docs/crashlytics)
- [CustomActivityOnCrash](https://github.com/Ereza/CustomActivityOnCrash)
- [MaterialAboutLibrary](https://github.com/daniel-stoneuk/material-about-library)

Vector Images from [FlatIcon](https://www.flaticon.com/).

Expand Down
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
/google-services.json
15 changes: 13 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

def supportLibVersion = '27.1.1'
def work_version = "1.0.0-alpha09"
def work_version = "1.0.0-alpha08"

android {

/* Disable multi apk for dev builds */
if (project.hasProperty('devBuild')) {
splits.abi.enable = false
splits.density.enable = false
aaptOptions.cruncherEnabled = false
}

compileSdkVersion 27
defaultConfig {
applicationId "com.thecoolguy.rumaan.fileio"
Expand Down Expand Up @@ -57,7 +64,9 @@ dependencies {
}
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:3.2.0"
// Firebase Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation 'com.google.firebase:firebase-core:16.0.3'
/* Room */
implementation 'android.arch.persistence.room:rxjava2:1.1.1'
Expand All @@ -75,9 +84,11 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.2'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

implementation 'androidx.core:core-ktx:0.3'
implementation "android.arch.work:work-runtime-ktx:$work_version"
androidTestImplementation "android.arch.work:work-testing:$work_version"

implementation 'com.github.daniel-stoneuk:material-about-library:2.3.0'

}

Expand Down
Binary file modified app/build/outputs/apk/debug/app-debug.apk
Binary file not shown.
8 changes: 7 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
tools:ignore="GoogleAppIndexingWarning"
android:allowBackup="true"
android:fullBackupContent="true">
<activity
android:launchMode="singleTop"
android:name=".ui.activities.MainActivity"
Expand Down Expand Up @@ -65,6 +67,10 @@
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts"/>

<activity android:name=".ui.activities.LicenseActivity"
android:parentActivityName=".ui.activities.AboutActivity"
android:theme="@style/AppTheme.MaterialAboutActivity"/>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ClearHistoryWorker : Worker() {
.uploadItemDao()
.clearAll()


return Result.SUCCESS
}
}
Expand All @@ -26,6 +25,6 @@ class DeleteSingleItemWorker : Worker() {
UploadHistoryRoomDatabase.getInstance(applicationContext)
.uploadItemDao()
.deleteItemWithId(id)
return Result.FAILURE
return Result.SUCCESS
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class UploadWorker : Worker() {

// post a notification
NotificationHelper().create(applicationContext, fileEntity)
val output: Data = workDataOf(KEY_RESULT to fileEntity.url)
outputData = output

outputData = workDataOf(KEY_RESULT to fileEntity.url)

return Result.SUCCESS
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.thecoolguy.rumaan.fileio.ui.activities

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.Menu
import android.view.MenuItem
import com.thecoolguy.rumaan.fileio.R
import kotlinx.android.synthetic.main.activity_about.toolbar

Expand All @@ -20,4 +22,12 @@ class AboutActivity : AppCompatActivity() {
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}

override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
R.id.menu_open_source -> startActivity(Intent(this,LicenseActivity::class.java))
else -> return false
}
return super.onOptionsItemSelected(item)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.thecoolguy.rumaan.fileio.ui.activities

import android.content.Context
import android.net.Uri
import com.danielstone.materialaboutlibrary.ConvenienceBuilder
import com.danielstone.materialaboutlibrary.MaterialAboutActivity
import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard
import com.danielstone.materialaboutlibrary.model.MaterialAboutList
import com.danielstone.materialaboutlibrary.util.OpenSourceLicense
import com.thecoolguy.rumaan.fileio.R

class LicenseActivity : MaterialAboutActivity() {

override fun getActivityTitle(): CharSequence? = "Open Source Licenses"

override fun getMaterialAboutList(context: Context): MaterialAboutList {
val icon = getDrawable(R.drawable.ic_library)
val apache = OpenSourceLicense.APACHE_2
val mit = OpenSourceLicense.MIT

val aospCard = ConvenienceBuilder
.createLicenseCard(context, icon, "AOSP Support Libraries", "2011", "The Android Open Source Project", apache)

val archCard = ConvenienceBuilder
.createLicenseCard(context, icon, "Architecture Components", "2017", "The Android Open Source Project", apache)

val malCard = ConvenienceBuilder
.createLicenseCard(context, icon, "MaterialAboutLibrary", "2016", "Daniel Stone", apache)

val fuelCard = ConvenienceBuilder
.createLicenseCard(context, icon, "Fuel", "2018", "Kittinun Vantasin", mit)

val npbCard = ConvenienceBuilder
.createLicenseCard(context, icon, "NumberProgressBar", "2014", "daimajia", mit)

val permissionCard = ConvenienceBuilder
.createLicenseCard(context, icon, "Permission Dispatcher", "2016", "Shintaro Katafuchi, Marcel Schnelle, Yoshinori Isogai", apache)

val crashCard = ConvenienceBuilder
.createLicenseCard(context, icon, "CustomActivityOnCrash", "2015", "Eduard Ereza Martínez", apache)

return MaterialAboutList(aospCard, archCard, malCard, fuelCard,
npbCard, permissionCard, crashCard)
}
}
Loading

0 comments on commit 37e1f07

Please sign in to comment.