diff --git a/.idea/misc.xml b/.idea/misc.xml index 37a7509..e0d5b93 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,34 @@ + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..ddfc5ae --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + android_client + Project android_client created by Buildship. + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/app/.classpath b/app/.classpath new file mode 100644 index 0000000..7c0adb0 --- /dev/null +++ b/app/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/.project b/app/.project new file mode 100644 index 0000000..ac485d7 --- /dev/null +++ b/app/.project @@ -0,0 +1,23 @@ + + + app + Project app created by Buildship. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + diff --git a/app/.settings/org.eclipse.buildship.core.prefs b/app/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..b1886ad --- /dev/null +++ b/app/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir=.. +eclipse.preferences.version=1 diff --git a/app/build.gradle b/app/build.gradle index df3d0d8..fa56444 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { applicationId "solidrive.com.android_client" minSdkVersion 23 - targetSdkVersion 27 + targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -16,12 +16,16 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + buildToolsVersion '28.0.2' } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:27.1.1' + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'com.google.android.material:material:1.0.0' 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' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 57b3ded..7142cf5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,11 +1,29 @@ + + + + - + android:theme="@style/AppTheme" + tools:ignore="GoogleAppIndexingWarning"> + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/solidrive/com/android_client/MainActivity.java b/app/src/main/java/solidrive/com/android_client/MainActivity.java new file mode 100644 index 0000000..637f73a --- /dev/null +++ b/app/src/main/java/solidrive/com/android_client/MainActivity.java @@ -0,0 +1,80 @@ +package solidrive.com.android_client; + +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.snackbar.Snackbar; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import android.view.View; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.TextView; + +public class MainActivity extends AppCompatActivity { + + private static final int PICKFILE_RESULT_CODE = 1; + private TextView textFile; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + textFile = findViewById(R.id.textToShow); + FloatingActionButton fab = findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + getFile(); + } + }); + } + + private void getFile() { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("*/*"); + startActivityForResult(intent,PICKFILE_RESULT_CODE); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_main, menu); + return true; + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + // TODO Auto-generated method stub + super.onActivityResult(requestCode, resultCode, data); + switch (requestCode) { + case PICKFILE_RESULT_CODE: + if (resultCode == RESULT_OK) { + String FilePath = data.getData().getPath(); + textFile.setText(FilePath); + } + break; + + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // 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. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } +} diff --git a/app/src/main/res/drawable/baseline_add_white_18dp.png b/app/src/main/res/drawable/baseline_add_white_18dp.png new file mode 100644 index 0000000..ea78104 Binary files /dev/null and b/app/src/main/res/drawable/baseline_add_white_18dp.png differ 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..1e59783 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + \ 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..1db34f0 --- /dev/null +++ b/app/src/main/res/layout/content_main.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml new file mode 100644 index 0000000..ee67be2 --- /dev/null +++ b/app/src/main/res/menu/menu_main.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/values/diemns.xml b/app/src/main/res/values/diemns.xml new file mode 100644 index 0000000..f76eef0 --- /dev/null +++ b/app/src/main/res/values/diemns.xml @@ -0,0 +1,4 @@ + + + 16dp + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a5d6df5..c69b970 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ - android_client + SoLiDrive Android Client + Settings diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5885930..545b9c6 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,4 +8,13 @@ @color/colorAccent + + +