diff options
author | Joe Robinson <joe@lc8n.com> | 2019-04-20 03:56:13 +0200 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2019-04-20 03:56:13 +0200 |
commit | 9d430209d39d0e68f6311adfff9d476c8856f662 (patch) | |
tree | f31e91badaafb62825e737e435d55cd89301a9ae /app |
Initial commit - working file list view
Diffstat (limited to 'app')
53 files changed, 935 insertions, 0 deletions
diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..8dc6fb0 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,42 @@ +apply plugin: 'com.android.application' + +apply plugin: 'kotlin-android' + +apply plugin: 'kotlin-android-extensions' + +apply plugin: "androidx.navigation.safeargs.kotlin" + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "uk.co.blatech.blaupload3" + minSdkVersion 19 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support:design:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + implementation 'com.natpryce:konfig:1.6.10.0' + implementation 'com.android.volley:volley:1.1.1' + implementation 'com.beust:klaxon:5.0.1' + implementation "androidx.navigation:navigation-fragment-ktx:2.1.0-alpha02" // For Kotlin use navigation-fragment-ktx + implementation "androidx.navigation:navigation-ui-ktx:2.1.0-alpha02" // For Kotlin use navigation-ui-ktx + + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -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 diff --git a/app/src/androidTest/java/uk/co/blatech/blaupload3/ExampleInstrumentedTest.kt b/app/src/androidTest/java/uk/co/blatech/blaupload3/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..b92a631 --- /dev/null +++ b/app/src/androidTest/java/uk/co/blatech/blaupload3/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package uk.co.blatech.blaupload3 + +import android.support.test.InstrumentationRegistry +import android.support.test.runner.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getTargetContext() + assertEquals("uk.co.blatech.blaupload3", appContext.packageName) + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7494ef3 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="uk.co.blatech.blaupload3"> + <uses-permission android:name="android.permission.INTERNET"/> + <application + android:allowBackup="true" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/AppTheme" + android:name="uk.co.blatech.blaupload3.util.AppController"> + <activity + android:name=".view.MainActivity" + android:label="@string/app_name" + android:theme="@style/AppTheme.NoActionBar"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + + </application> + +</manifest>
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt b/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt new file mode 100644 index 0000000..677b852 --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt @@ -0,0 +1,30 @@ +package uk.co.blatech.blaupload3.model + +import java.net.URI +import java.text.SimpleDateFormat +import java.util.* + +data class File (var filename: String, var type: String, var modified: Long, var size: Long) { + + var url = URI("http://wupload.of.je/$filename") + var thumb_url = URI("http://wupload.of.je/thumbs/$filename") + var modified_formatted = SimpleDateFormat("dd/MM/yyyy mm:HH:ss").format(Date(modified*1000)) + val units = arrayOf<String>("B", "kB", "MB", "GB", "TB") + var size_lambda = { size : Long -> + var curSize = size.toDouble() + var curUnit = units[0] + for (i in 0 until units.size-1) { + if (curSize < 1000) { + break + } + curSize /= 1000 + curUnit = units[i+1] + } + val sizeRounded = String.format("%.3g", curSize) + "$sizeRounded $curUnit" + } + + var size_formatted = size_lambda(size) + + +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/model/Image.kt b/app/src/main/java/uk/co/blatech/blaupload3/model/Image.kt new file mode 100644 index 0000000..1ca0bff --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/model/Image.kt @@ -0,0 +1,7 @@ +//package uk.co.blatech.blaupload3.model +// +//import android.graphics.Bitmap +// +//class Image(filename: String, image: Bitmap, type: String, modified: Long, size: Long) : File(filename, type, modified, size) { +// +//}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/model/Video.kt b/app/src/main/java/uk/co/blatech/blaupload3/model/Video.kt new file mode 100644 index 0000000..5882114 --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/model/Video.kt @@ -0,0 +1,4 @@ +//package uk.co.blatech.blaupload3.model +// +//class Video(filename: String, type: String, modified: Long, size: Long) : File(filename, type, modified, size) { +//}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/AppController.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/AppController.kt new file mode 100644 index 0000000..feb0b6d --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/AppController.kt @@ -0,0 +1,67 @@ +package uk.co.blatech.blaupload3.util + +import android.app.Application +import android.text.TextUtils +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.toolbox.ImageLoader +import com.android.volley.toolbox.Volley + + +class AppController : Application() { + + private var mRequestQueue: RequestQueue? = null + private var mImageLoader: ImageLoader? = null + + val requestQueue: RequestQueue + get() { + if (mRequestQueue == null) { + mRequestQueue = Volley.newRequestQueue(applicationContext) + } + + return mRequestQueue!! + } + + val imageLoader: ImageLoader + get() { + requestQueue + if (mImageLoader == null) { + mImageLoader = ImageLoader( + this.mRequestQueue, + LruBitmapCache() + ) + } + return mImageLoader!! + } + + override fun onCreate() { + super.onCreate() + instance = this + } + + fun <T> addToRequestQueue(req: Request<T>, tag: String) { + // set the default tag if tag is empty + req.tag = if (TextUtils.isEmpty(tag)) TAG else tag + requestQueue.add(req) + } + + fun <T> addToRequestQueue(req: Request<T>) { + req.tag = TAG + requestQueue.add(req) + } + + fun cancelPendingRequests(tag: Any) { + if (mRequestQueue != null) { + mRequestQueue!!.cancelAll(tag) + } + } + + companion object { + + val TAG = AppController::class.java.simpleName + + @get:Synchronized + var instance: AppController? = null + private set + } +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/Config.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/Config.kt new file mode 100644 index 0000000..2b7356b --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/Config.kt @@ -0,0 +1,12 @@ +//package uk.co.blatech.blaupload3.util +// +//import com.natpryce.konfig.* +//import com.natpryce.konfig.ConfigurationProperties.Companion.systemProperties +// +//class Config { +// val server_url = Key("server.url", stringType) +// +// val config = systemProperties() overriding +// EnvironmentVariables() overriding +// ConfigurationProperties.fromResource("application.properties") +//}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt new file mode 100644 index 0000000..b32fe6c --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt @@ -0,0 +1,37 @@ +package uk.co.blatech.blaupload3.util + +import android.content.Context +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.BaseAdapter +import uk.co.blatech.blaupload3.model.File +import kotlinx.android.synthetic.main.file_list_row.view.* +import uk.co.blatech.blaupload3.R + + +class FileListAdapter(private val context: Context, private val fileList : ArrayList<File>) : BaseAdapter() { + private val infater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater + var imageLoader = AppController.instance?.imageLoader + override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { + val listRow = infater.inflate(R.layout.file_list_row, parent, false) + listRow.list_filename.text = fileList[position].filename + listRow.list_modified.text = fileList[position].modified_formatted.toString() + listRow.list_size.text = fileList[position].size_formatted + listRow.list_thumbnail.setImageUrl(fileList[position].thumb_url.toASCIIString(), imageLoader) + return listRow + } + + override fun getItem(position: Int): Any { + return fileList[position] + } + + override fun getItemId(position: Int): Long { + return position.toLong() + } + + override fun getCount(): Int { + return fileList.size + } + +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/JSONLoader.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/JSONLoader.kt new file mode 100644 index 0000000..dff7043 --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/JSONLoader.kt @@ -0,0 +1,43 @@ +package uk.co.blatech.blaupload3.util + +import android.content.Context +import android.util.Log +import android.widget.ListView +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.toolbox.JsonArrayRequest +import com.android.volley.toolbox.Volley +import org.json.JSONArray +import uk.co.blatech.blaupload3.model.File + + +class JSONLoader { + companion object { + + fun getJsonListing(context: Context?, listView: ListView) { + val queue = Volley.newRequestQueue(context) + val url = "http://wupload.of.je/?format=json" + var fileList = ArrayList<File>() + val jsonRequest = JsonArrayRequest( + Request.Method.GET, + url, + null, + Response.Listener<JSONArray> { response -> + + for (i in 0 until response.length()) { + var jsonObj = response.getJSONObject(i) + var upload: File = File(filename =jsonObj.getString("filename"), type = jsonObj.getString("type"), modified = jsonObj.getLong("modified"), size = jsonObj.getLong("size")) + fileList.add(upload) + + + } + if (context != null) { + listView.adapter = FileListAdapter(context, fileList) + } + }, + Response.ErrorListener { Log.e("json error", "narp")}) + queue.add(jsonRequest) + + } + } +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/LruBitmapCache.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/LruBitmapCache.kt new file mode 100644 index 0000000..7fcc62e --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/LruBitmapCache.kt @@ -0,0 +1,28 @@ +package uk.co.blatech.blaupload3.util + +import android.graphics.Bitmap +import android.util.LruCache +import com.android.volley.toolbox.ImageLoader + +class LruBitmapCache constructor(sizeInKB: Int = defaultLruCacheSize): + LruCache<String, Bitmap>(sizeInKB), ImageLoader.ImageCache { + override fun sizeOf(key: String, value: Bitmap): Int = value.rowBytes * value.height / 1024 + + override fun getBitmap(url: String): Bitmap? { + return get(url) + } + + override fun putBitmap(url: String, bitmap: Bitmap) { + put(url, bitmap) + } + + companion object { + val defaultLruCacheSize: Int + get() { + val maxMemory = (Runtime.getRuntime().maxMemory() / 1024).toInt() + val cacheSize = maxMemory / 8 + return cacheSize + } + } + +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/view/ListFragment.kt b/app/src/main/java/uk/co/blatech/blaupload3/view/ListFragment.kt new file mode 100644 index 0000000..87a3db5 --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/view/ListFragment.kt @@ -0,0 +1,21 @@ +package uk.co.blatech.blaupload3.view + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import uk.co.blatech.blaupload3.R +import uk.co.blatech.blaupload3.util.JSONLoader + +class ListFragment : Fragment() { + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + super.onCreate(savedInstanceState) + return inflater.inflate(R.layout.list_fragment, container, false) + + } + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + JSONLoader.getJsonListing(activity?.applicationContext, activity?.findViewById(R.id.file_list)!!) + } +}
\ No newline at end of file diff --git a/app/src/main/java/uk/co/blatech/blaupload3/view/MainActivity.kt b/app/src/main/java/uk/co/blatech/blaupload3/view/MainActivity.kt new file mode 100644 index 0000000..1d4b7a5 --- /dev/null +++ b/app/src/main/java/uk/co/blatech/blaupload3/view/MainActivity.kt @@ -0,0 +1,70 @@ +package uk.co.blatech.blaupload3.view + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import android.view.Menu +import android.view.MenuItem +import androidx.navigation.NavController +import kotlinx.android.synthetic.main.activity_main.* +import androidx.navigation.Navigation +import androidx.navigation.ui.NavigationUI +import com.google.android.material.navigation.NavigationView +import uk.co.blatech.blaupload3.R + + +class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener { + + private lateinit var navController : NavController + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + navController = Navigation.findNavController(this, R.id.nav_host_fragment) + NavigationUI.setupWithNavController(nav_view, navController) + nav_view.setNavigationItemSelectedListener(this) + + } + + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + + // Inflate the menu; this adds items to the action bar if it is present. + menuInflater.inflate(R.menu.main, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + when (item.itemId) { + R.id.action_settings -> return true + else -> return super.onOptionsItemSelected(item) + } + } + + override fun onNavigationItemSelected(item: MenuItem): Boolean { + // Handle navigation view item clicks here. + when (item.itemId) { + R.id.nav_upload -> { + + // Handle the camera action + } + R.id.nav_gallery -> { + navController.navigate(R.id.file_list) +// } + } + R.id.nav_settings -> { + + } + R.id.nav_share -> { + + } + R.id.nav_send -> { + + } + } + +// drawer_layout.closeDrawer(GravityCompat.START) + return true + } +} diff --git a/app/src/main/res/drawable-v21/ic_menu_camera.xml b/app/src/main/res/drawable-v21/ic_menu_camera.xml new file mode 100644 index 0000000..41688d5 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_camera.xml @@ -0,0 +1,12 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/> + <path + android:fillColor="#FF000000" + android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/> +</vector> diff --git a/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/app/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100644 index 0000000..ff8ce52 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z"/> +</vector> diff --git a/app/src/main/res/drawable-v21/ic_menu_manage.xml b/app/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100644 index 0000000..a0e423c --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z"/> +</vector>
\ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_menu_send.xml b/app/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100644 index 0000000..9745066 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/> +</vector> diff --git a/app/src/main/res/drawable-v21/ic_menu_share.xml b/app/src/main/res/drawable-v21/ic_menu_share.xml new file mode 100644 index 0000000..b3e39e2 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_share.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/> +</vector> diff --git a/app/src/main/res/drawable-v21/ic_menu_slideshow.xml b/app/src/main/res/drawable-v21/ic_menu_slideshow.xml new file mode 100644 index 0000000..ae51e49 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_slideshow.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z"/> +</vector> diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..6348baa --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportHeight="108" + android:viewportWidth="108"> + <path + android:fillType="evenOdd" + android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z" + android:strokeColor="#00000000" + android:strokeWidth="1"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="78.5885" + android:endY="90.9159" + android:startX="48.7653" + android:startY="61.0927" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0"/> + <item + android:color="#00000000" + android:offset="1.0"/> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z" + android:strokeColor="#00000000" + android:strokeWidth="1"/> +</vector> diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..a0ad202 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:height="108dp" + android:width="108dp" + android:viewportHeight="108" + android:viewportWidth="108"> + <path android:fillColor="#008577" + android:pathData="M0,0h108v108h-108z"/> + <path android:fillColor="#00000000" android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> +</vector> diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..a33798b --- /dev/null +++ b/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <gradient + android:angle="135" + android:centerColor="#009688" + android:endColor="#00695C" + android:startColor="#4DB6AC" + android:type="linear"/> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..4cc95a2 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.drawerlayout.widget.DrawerLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/drawer_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true" + tools:openDrawer="start"> + + <!--<include--> + <!--layout="@layout/app_bar_main"--> + <!--android:layout_width="match_parent"--> + <!--android:layout_height="match_parent"/>--> + <fragment + android:name="androidx.navigation.fragment.NavHostFragment" + android:id="@+id/nav_host_fragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:defaultNavHost="true" + app:navGraph="@navigation/nav_graph" + /> + + + <com.google.android.material.navigation.NavigationView + android:id="@+id/nav_view" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_gravity="start" + android:fitsSystemWindows="true" + app:headerLayout="@layout/nav_header_main" + app:menu="@menu/activity_main_drawer"/> + +</androidx.drawerlayout.widget.DrawerLayout> diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml new file mode 100644 index 0000000..d2e32b7 --- /dev/null +++ b/app/src/main/res/layout/app_bar_main.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.design.widget.CoordinatorLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".view.MainActivity"> + + <android.support.design.widget.AppBarLayout + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:theme="@style/AppTheme.AppBarOverlay"> + + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="?attr/colorPrimary" + app:popupTheme="@style/AppTheme.PopupOverlay"/> + + </android.support.design.widget.AppBarLayout> + + <include layout="@layout/content_main"/> + + <android.support.design.widget.FloatingActionButton + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + android:layout_margin="@dimen/fab_margin" + app:srcCompat="@android:drawable/ic_dialog_email"/> + +</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml new file mode 100644 index 0000000..1107ca8 --- /dev/null +++ b/app/src/main/res/layout/content_main.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" + android:id="@+id/main_fragment" + tools:context=".view.MainActivity"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hello World!" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" android:id="@+id/texty"/> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/file_list_row.xml b/app/src/main/res/layout/file_list_row.xml new file mode 100644 index 0000000..fe6c34c --- /dev/null +++ b/app/src/main/res/layout/file_list_row.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + <com.android.volley.toolbox.NetworkImageView + android:id="@+id/list_thumbnail" + android:layout_width="100dp" + android:layout_height="100dp" + android:layout_alignParentLeft="true" + android:layout_marginRight="8dp" /> + <TextView + android:id="@+id/list_filename" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignTop="@id/list_filename" + android:layout_toRightOf="@id/list_thumbnail" + android:textColor="@android:color/black" + /> + <TextView + android:id="@+id/list_modified" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/list_filename" + android:layout_toRightOf="@id/list_thumbnail" + android:layout_alignParentBottom="true" + android:textColor="@android:color/black" + /> + <TextView + android:id="@+id/list_size" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:layout_below="@id/list_filename" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:textAlignment="viewEnd" + android:textColor="@android:color/black" + + /> + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/image_list_item.xml b/app/src/main/res/layout/image_list_item.xml new file mode 100644 index 0000000..6c159a4 --- /dev/null +++ b/app/src/main/res/layout/image_list_item.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/list_fragment.xml b/app/src/main/res/layout/list_fragment.xml new file mode 100644 index 0000000..573c7ed --- /dev/null +++ b/app/src/main/res/layout/list_fragment.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/list_fragment"> + + <ListView + android:id="@+id/file_list" + android:layout_width="fill_parent" + android:layout_height="wrap_content" /> + +</RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml new file mode 100644 index 0000000..92ca611 --- /dev/null +++ b/app/src/main/res/layout/nav_header_main.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="@dimen/nav_header_height" + android:background="@drawable/side_nav_bar" + android:paddingBottom="@dimen/activity_vertical_margin" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" + android:theme="@style/ThemeOverlay.AppCompat.Dark" + android:orientation="vertical" + android:gravity="bottom"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="@dimen/nav_header_vertical_spacing" + app:srcCompat="@mipmap/ic_launcher_round" + android:contentDescription="@string/nav_header_desc" + android:id="@+id/imageView"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/nav_header_vertical_spacing" + android:text="@string/nav_header_title" + android:textAppearance="@style/TextAppearance.AppCompat.Body1"/> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/nav_header_subtitle" + android:id="@+id/textView"/> + +</LinearLayout> diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml new file mode 100644 index 0000000..cab4f73 --- /dev/null +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:showIn="navigation_view"> + + <group android:checkableBehavior="single"> + <item + android:id="@+id/nav_upload" + android:icon="@drawable/ic_menu_camera" + android:title="Upload"/> + <item + android:id="@+id/nav_gallery" + android:icon="@drawable/ic_menu_gallery" + android:title="Gallery"/> + <item + android:id="@+id/nav_settings" + android:icon="@drawable/ic_menu_manage" + android:title="Settings"/> + </group> + + <item android:title="Communicate"> + <menu> + <item + android:id="@+id/nav_share" + android:icon="@drawable/ic_menu_share" + android:title="Share"/> + <item + android:id="@+id/nav_send" + android:icon="@drawable/ic_menu_send" + android:title="Send"/> + </menu> + </item> + +</menu> diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml new file mode 100644 index 0000000..d579f6f --- /dev/null +++ b/app/src/main/res/menu/main.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <item android:id="@+id/action_settings" + android:title="@string/action_settings" + android:orderInCategory="100" + app:showAsAction="never"/> +</menu> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@drawable/ic_launcher_foreground"/> +</adaptive-icon>
\ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..bbd3e02 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@drawable/ic_launcher_foreground"/> +</adaptive-icon>
\ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..898f3ed --- /dev/null +++ b/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..dffca36 --- /dev/null +++ b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..64ba76f --- /dev/null +++ b/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..dae5e08 --- /dev/null +++ b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..e5ed465 --- /dev/null +++ b/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..14ed0af --- /dev/null +++ b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..b0907ca --- /dev/null +++ b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..d8ae031 --- /dev/null +++ b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..2c18de9 --- /dev/null +++ b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..beed3cd --- /dev/null +++ b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml new file mode 100644 index 0000000..ef2595c --- /dev/null +++ b/app/src/main/res/navigation/nav_graph.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<navigation xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/nav_graph" + app:startDestination="@id/main_fragment"> +> + <fragment + android:id="@+id/main_fragment" + android:name="uk.co.blatech.blaupload3.view.ListFragment" + android:label="First Fragment" + tools:layout="@layout/list_fragment" /> + <fragment + android:id="@+id/list_fragment" + android:name="uk.co.blatech.blaupload3.view.ListFragment" + android:label="First Fragment" + tools:layout="@layout/list_fragment" /> +</navigation>
\ No newline at end of file diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..e546804 --- /dev/null +++ b/app/src/main/res/values-v21/styles.xml @@ -0,0 +1,7 @@ +<resources> + <style name="AppTheme.NoActionBar"> + <item name="windowActionBar">false</item> + <item name="windowNoTitle">true</item> + <item name="android:statusBarColor">@android:color/transparent</item> + </style> +</resources> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..69b2233 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="colorPrimary">#008577</color> + <color name="colorPrimaryDark">#00574B</color> + <color name="colorAccent">#D81B60</color> +</resources> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..4ab4520 --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,8 @@ +<resources> + <!-- Default screen margins, per the Android Design guidelines. --> + <dimen name="activity_horizontal_margin">16dp</dimen> + <dimen name="activity_vertical_margin">16dp</dimen> + <dimen name="nav_header_vertical_spacing">8dp</dimen> + <dimen name="nav_header_height">176dp</dimen> + <dimen name="fab_margin">16dp</dimen> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/drawables.xml b/app/src/main/res/values/drawables.xml new file mode 100644 index 0000000..52c6a6c --- /dev/null +++ b/app/src/main/res/values/drawables.xml @@ -0,0 +1,8 @@ +<resources xmlns:android="http://schemas.android.com/apk/res/android"> + <item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item> + <item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item> + <item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item> + <item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item> + <item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item> + <item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item> +</resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..e84590e --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ +<resources> + <string name="app_name">Blaupload3</string> + <string name="navigation_drawer_open">Open navigation drawer</string> + <string name="navigation_drawer_close">Close navigation drawer</string> + <string name="nav_header_title">Blaupload</string> + <string name="nav_header_subtitle">android.studio@android.com</string> + <string name="nav_header_desc">Navigation header</string> + <string name="action_settings">Settings</string> +</resources> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..16dbab3 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,17 @@ +<resources> + + <!-- Base application theme. --> + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> + <!-- Customize your theme here. --> + <item name="colorPrimary">@color/colorPrimary</item> + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> + <item name="colorAccent">@color/colorAccent</item> + </style> + <style name="AppTheme.NoActionBar"> + <item name="windowActionBar">false</item> + <item name="windowNoTitle">true</item> + </style> + <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/> + <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/> + +</resources> diff --git a/app/src/test/java/uk/co/blatech/blaupload3/ExampleUnitTest.kt b/app/src/test/java/uk/co/blatech/blaupload3/ExampleUnitTest.kt new file mode 100644 index 0000000..c90a846 --- /dev/null +++ b/app/src/test/java/uk/co/blatech/blaupload3/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package uk.co.blatech.blaupload3 + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} |