From 86f3bbb08cc8866d774b31ef52c3a00f40dc471c Mon Sep 17 00:00:00 2001 From: Felix Prahl-Kamps Date: Tue, 11 Jun 2019 14:52:41 +0200 Subject: [PATCH] improve design --- app/build.gradle | 10 +- app/src/main/AndroidManifest.xml | 7 +- .../mispbump/activities/HomeActivity.java | 170 ++++----------- .../mispbump/activities/LoginActivity.java | 2 +- .../mispbump/activities/MainActivity.java | 24 --- .../mispbump/activities/ProfileActivity.java | 197 ++++++++++++++++++ .../mispbump/activities/SyncActivity.java | 45 ++-- .../circl/mispbump/adapters/SyncAdapter.java | 53 +++-- .../circl/mispbump/auxiliary/TileDrawable.kt | 49 +++++ .../custom_views/MaterialPreferenceText.java | 47 +++++ .../mispbump/fragments/HomeFragment.java | 8 + .../mispbump/models/UploadInformation.java | 55 ++++- app/src/main/res/anim/fade_in.xml | 8 + app/src/main/res/anim/fade_out.xml | 8 + app/src/main/res/animator/rotation_cw.xml | 10 + app/src/main/res/drawable/animated_sync.xml | 8 + .../bottom_navigation_color_states.xml | 5 + .../main/res/drawable/ic_arrow_forward.xml | 5 + app/src/main/res/drawable/ic_bank_note.xml | 13 ++ .../main/res/drawable/ic_circuit_board.xml | 10 + app/src/main/res/drawable/ic_close.xml | 5 + .../main/res/drawable/ic_code_black_24dp.xml | 5 + app/src/main/res/drawable/ic_description.xml | 5 + .../main/res/drawable/ic_error_outline.xml | 5 + app/src/main/res/drawable/ic_language.xml | 5 + app/src/main/res/drawable/ic_polka_dots.xml | 13 ++ app/src/main/res/drawable/ic_qrcode.xml | 8 + app/src/main/res/drawable/ic_qrcode_scan.xml | 8 + app/src/main/res/drawable/ic_settings.xml | 5 + .../main/res/drawable/ic_sync_black_24dp.xml | 21 +- app/src/main/res/drawable/ic_wiggle.xml | 11 + app/src/main/res/layout/actionbar_home.xml | 21 -- app/src/main/res/layout/activity_home.xml | 96 ++------- app/src/main/res/layout/activity_login.xml | 2 +- app/src/main/res/layout/activity_main.xml | 18 -- app/src/main/res/layout/activity_profile.xml | 144 +++++++++++++ app/src/main/res/layout/activity_sync.xml | 2 +- app/src/main/res/layout/activity_sync_2.xml | 51 +++++ .../res/layout/material_preference_text.xml | 48 +++++ app/src/main/res/layout/viewholder_sync.xml | 85 -------- .../main/res/layout/viewholder_sync_card.xml | 81 +++++++ app/src/main/res/menu/main_menu.xml | 14 +- .../main/res/menu/menu_bottom_navigation.xml | 19 -- app/src/main/res/menu/menu_profile.xml | 9 + app/src/main/res/menu/menu_sync.xml | 9 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values/attrs.xml | 8 + app/src/main/res/values/colors.xml | 8 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/styles.xml | 16 ++ build.gradle | 5 +- 51 files changed, 1029 insertions(+), 434 deletions(-) delete mode 100644 app/src/main/java/lu/circl/mispbump/activities/MainActivity.java create mode 100644 app/src/main/java/lu/circl/mispbump/activities/ProfileActivity.java create mode 100644 app/src/main/java/lu/circl/mispbump/auxiliary/TileDrawable.kt create mode 100644 app/src/main/java/lu/circl/mispbump/custom_views/MaterialPreferenceText.java create mode 100644 app/src/main/java/lu/circl/mispbump/fragments/HomeFragment.java create mode 100644 app/src/main/res/anim/fade_in.xml create mode 100644 app/src/main/res/anim/fade_out.xml create mode 100644 app/src/main/res/animator/rotation_cw.xml create mode 100644 app/src/main/res/drawable/animated_sync.xml create mode 100644 app/src/main/res/drawable/bottom_navigation_color_states.xml create mode 100644 app/src/main/res/drawable/ic_arrow_forward.xml create mode 100644 app/src/main/res/drawable/ic_bank_note.xml create mode 100644 app/src/main/res/drawable/ic_circuit_board.xml create mode 100644 app/src/main/res/drawable/ic_close.xml create mode 100644 app/src/main/res/drawable/ic_code_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_description.xml create mode 100644 app/src/main/res/drawable/ic_error_outline.xml create mode 100644 app/src/main/res/drawable/ic_language.xml create mode 100644 app/src/main/res/drawable/ic_polka_dots.xml create mode 100644 app/src/main/res/drawable/ic_qrcode.xml create mode 100644 app/src/main/res/drawable/ic_qrcode_scan.xml create mode 100644 app/src/main/res/drawable/ic_settings.xml create mode 100644 app/src/main/res/drawable/ic_wiggle.xml delete mode 100644 app/src/main/res/layout/actionbar_home.xml delete mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_profile.xml create mode 100644 app/src/main/res/layout/activity_sync_2.xml create mode 100644 app/src/main/res/layout/material_preference_text.xml delete mode 100644 app/src/main/res/layout/viewholder_sync.xml create mode 100644 app/src/main/res/layout/viewholder_sync_card.xml delete mode 100644 app/src/main/res/menu/menu_bottom_navigation.xml create mode 100644 app/src/main/res/menu/menu_profile.xml create mode 100644 app/src/main/res/menu/menu_sync.xml create mode 100644 app/src/main/res/values/attrs.xml diff --git a/app/build.gradle b/app/build.gradle index cdb0917..9dab2d3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-android' android { compileSdkVersion 28 @@ -9,6 +11,7 @@ android { versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + vectorDrawables.useSupportLibrary = true } buildTypes { release { @@ -26,8 +29,9 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0' // android - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:design:28.0.0' + implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:cardview-v7:28.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' @@ -47,4 +51,8 @@ dependencies { 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' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} +repositories { + mavenCentral() } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ba401db..97c6395 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,6 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> - @@ -33,6 +32,12 @@ android:name=".activities.SyncActivity" android:label="@string/sync" android:parentActivityName=".activities.HomeActivity" /> + + \ No newline at end of file diff --git a/app/src/main/java/lu/circl/mispbump/activities/HomeActivity.java b/app/src/main/java/lu/circl/mispbump/activities/HomeActivity.java index 4954665..9e28d72 100644 --- a/app/src/main/java/lu/circl/mispbump/activities/HomeActivity.java +++ b/app/src/main/java/lu/circl/mispbump/activities/HomeActivity.java @@ -1,23 +1,20 @@ package lu.circl.mispbump.activities; -import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; import android.support.v7.app.ActionBar; -import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; -import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.TextView; +import android.widget.Toast; import java.util.List; @@ -26,67 +23,38 @@ import lu.circl.mispbump.adapters.SyncAdapter; import lu.circl.mispbump.auxiliary.PreferenceManager; import lu.circl.mispbump.models.UploadInformation; import lu.circl.mispbump.restful_client.MispRestClient; -import lu.circl.mispbump.restful_client.Organisation; -import lu.circl.mispbump.restful_client.User; -import lu.circl.mispbump.security.KeyStoreWrapper; public class HomeActivity extends AppCompatActivity { public static final String TAG = "Home"; private CoordinatorLayout layout; - private TextView title; - private RecyclerView recyclerView; private PreferenceManager preferenceManager; - private MispRestClient mispRestClient; + + private View.OnClickListener onFabClicked = new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent sync = new Intent(HomeActivity.this, SyncActivity.class); + startActivity(sync); + } + }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); - // populate Toolbar (Actionbar) - Toolbar myToolbar = findViewById(R.id.toolbar); - setSupportActionBar(myToolbar); - - ActionBar ab = getSupportActionBar(); - if (ab != null) { - ab.setDisplayHomeAsUpEnabled(false); - } - - View titleView = getLayoutInflater().inflate(R.layout.actionbar_home, null); - title = titleView.findViewById(R.id.actionbar_title); - - ActionBar.LayoutParams params = new ActionBar.LayoutParams( - ActionBar.LayoutParams.WRAP_CONTENT, - ActionBar.LayoutParams.MATCH_PARENT, - Gravity.CENTER); - - ab.setCustomView(titleView, params); - ab.setDisplayShowCustomEnabled(true); - ab.setDisplayShowTitleEnabled(false); - - layout = findViewById(R.id.layout); - - recyclerView = findViewById(R.id.recyclerView); - recyclerView.setLayoutManager(new LinearLayoutManager(this)); - preferenceManager = PreferenceManager.getInstance(this); - mispRestClient = new MispRestClient(this); - populateViewsWithInfo(); + initializeViews(); + } + + @Override + protected void onResume() { + super.onResume(); populateRecyclerView(); - - FloatingActionButton sync_fab = findViewById(R.id.home_fab); - sync_fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent i = new Intent(getApplicationContext(), SyncActivity.class); - startActivity(i); - } - }); } @Override @@ -97,13 +65,13 @@ public class HomeActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == R.id.main_menu_clear_and_logout) { - clearDeviceAndLogOut(); + if (item.getItemId() == R.id.menu_settings) { return true; } - if (item.getItemId() == R.id.update) { - updateProfile(); + if (item.getItemId() == R.id.menu_profile) { + Intent profile = new Intent(HomeActivity.this, ProfileActivity.class); + startActivity(profile); return true; } @@ -111,88 +79,40 @@ public class HomeActivity extends AppCompatActivity { return super.onOptionsItemSelected(item); } + private void initializeViews() { + layout = findViewById(R.id.rootLayout); - public void updateProfile() { - mispRestClient.getMyUser(new MispRestClient.UserCallback() { - @Override - public void success(final User user) { + // populate Toolbar (Actionbar) + Toolbar myToolbar = findViewById(R.id.toolbar); + setSupportActionBar(myToolbar); - preferenceManager.setUserInfo(user); + ActionBar ab = getSupportActionBar(); + if (ab != null) { + ab.setDisplayHomeAsUpEnabled(false); + } - mispRestClient.getOrganisation(user.org_id, new MispRestClient.OrganisationCallback() { - @Override - public void success(Organisation organisation) { - preferenceManager.setUserOrgInfo(organisation); - populateViewsWithInfo(); - } + recyclerView = findViewById(R.id.recyclerView); + recyclerView.setLayoutManager(new LinearLayoutManager(this)); - @Override - public void failure(String error) { - Snackbar.make(layout, error, Snackbar.LENGTH_LONG).show(); - } - }); - } - - @Override - public void failure(String error) { - Snackbar.make(layout, error, Snackbar.LENGTH_LONG).show(); - } - }); - } - - private void populateViewsWithInfo() { - Organisation org = preferenceManager.getUserOrganisation(); - title.setText(org.name); - - TextView userCount = findViewById(R.id.user_count); - userCount.setText("" + org.user_count); - - TextView sector = findViewById(R.id.sector); - sector.setText(org.sector); - - TextView nationality = findViewById(R.id.nationality); - nationality.setText(org.nationality); + FloatingActionButton sync_fab = findViewById(R.id.home_fab); + sync_fab.setOnClickListener(onFabClicked); } private void populateRecyclerView() { List uploadInformationList = preferenceManager.getUploadInformation(); - Log.i(TAG, "Size: " + uploadInformationList.size()); - SyncAdapter syncAdapter = new SyncAdapter(uploadInformationList); + + TextView empty = findViewById(R.id.emtpy); + + if (uploadInformationList == null) { + empty.setVisibility(View.VISIBLE); + recyclerView.setVisibility(View.GONE); + return; + } + + empty.setVisibility(View.GONE); + recyclerView.setVisibility(View.VISIBLE); + + SyncAdapter syncAdapter = new SyncAdapter(uploadInformationList, HomeActivity.this); recyclerView.setAdapter(syncAdapter); } - - private void clearDeviceAndLogOut() { - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - - builder.setTitle("Clear all saved data and logout"); - builder.setMessage("Do you really want to delete all data and logout?"); - builder.setNegativeButton("Discard", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.cancel(); - } - }); - - builder.setPositiveButton("Delete & Logout", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - PreferenceManager prefs = PreferenceManager.getInstance(getApplicationContext()); - prefs.clearAllData(); - KeyStoreWrapper.deleteAllStoredKeys(); - - Intent login = new Intent(getApplicationContext(), LoginActivity.class); - startActivity(login); - finish(); - } - }); - - builder.create().show(); - } - - @Override - protected void onResume() { - super.onResume(); - populateRecyclerView(); - } } diff --git a/app/src/main/java/lu/circl/mispbump/activities/LoginActivity.java b/app/src/main/java/lu/circl/mispbump/activities/LoginActivity.java index 344624e..8c3bdcd 100644 --- a/app/src/main/java/lu/circl/mispbump/activities/LoginActivity.java +++ b/app/src/main/java/lu/circl/mispbump/activities/LoginActivity.java @@ -50,7 +50,7 @@ public class LoginActivity extends AppCompatActivity { ab.setDisplayHomeAsUpEnabled(false); } - constraintLayout = findViewById(R.id.layout); + constraintLayout = findViewById(R.id.rootLayout); progressBar = findViewById(R.id.login_progressbar); serverUrl = findViewById(R.id.login_server_url); serverAutomationKey = findViewById(R.id.login_automation_key); diff --git a/app/src/main/java/lu/circl/mispbump/activities/MainActivity.java b/app/src/main/java/lu/circl/mispbump/activities/MainActivity.java deleted file mode 100644 index 42eac6a..0000000 --- a/app/src/main/java/lu/circl/mispbump/activities/MainActivity.java +++ /dev/null @@ -1,24 +0,0 @@ -package lu.circl.mispbump.activities; - -import android.os.Bundle; -import android.support.design.widget.BottomNavigationView; -import android.support.v7.app.AppCompatActivity; - -import lu.circl.mispbump.R; - -public class MainActivity extends AppCompatActivity { - - private BottomNavigationView bottomNavigationView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - initializeViews(); - } - - private void initializeViews() { -// bottomNavigationView = findViewById(R.id.bottom_navigation); - } -} diff --git a/app/src/main/java/lu/circl/mispbump/activities/ProfileActivity.java b/app/src/main/java/lu/circl/mispbump/activities/ProfileActivity.java new file mode 100644 index 0000000..793f596 --- /dev/null +++ b/app/src/main/java/lu/circl/mispbump/activities/ProfileActivity.java @@ -0,0 +1,197 @@ +package lu.circl.mispbump.activities; + +import android.content.DialogInterface; +import android.content.Intent; +import android.graphics.Shader; +import android.graphics.drawable.AnimatedVectorDrawable; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.support.design.widget.CoordinatorLayout; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v4.widget.ContentLoadingProgressBar; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.animation.RotateAnimation; +import android.widget.ImageView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import java.util.Random; + +import lu.circl.mispbump.R; +import lu.circl.mispbump.auxiliary.PreferenceManager; +import lu.circl.mispbump.auxiliary.TileDrawable; +import lu.circl.mispbump.custom_views.MaterialPreferenceText; +import lu.circl.mispbump.restful_client.MispRestClient; +import lu.circl.mispbump.restful_client.Organisation; +import lu.circl.mispbump.restful_client.User; +import lu.circl.mispbump.security.KeyStoreWrapper; + +public class ProfileActivity extends AppCompatActivity { + + private CoordinatorLayout rootLayout; + private MispRestClient mispRestClient; + private PreferenceManager preferenceManager; + + private FloatingActionButton fab; + private AnimatedVectorDrawable fabLoadingDrawable; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_profile); + + mispRestClient = new MispRestClient(this); + preferenceManager = PreferenceManager.getInstance(this); + + initializeViews(); + populateInformationViews(); + } + + private void initializeViews() { + rootLayout = findViewById(R.id.rootLayout); + + ImageView headerBg = findViewById(R.id.headerBg); + headerBg.setImageDrawable(new TileDrawable(getRandomHeader(), Shader.TileMode.REPEAT)); + + // populate Toolbar (Actionbar) + Toolbar myToolbar = findViewById(R.id.toolbar); + setSupportActionBar(myToolbar); + + ActionBar ab = getSupportActionBar(); + if (ab != null) { + ab.setDisplayHomeAsUpEnabled(true); + ab.setDisplayShowTitleEnabled(true); + } + + fab = findViewById(R.id.fab); + fab.setOnClickListener(onFabClicked()); + + fabLoadingDrawable = (AnimatedVectorDrawable) getDrawable(R.drawable.animated_sync); + } + + private void populateInformationViews() { + Organisation organisation = preferenceManager.getUserOrganisation(); + + TextView name = findViewById(R.id.orgName); + name.setText(organisation.name); + + MaterialPreferenceText uuid = findViewById(R.id.uuid); + uuid.setSubText(organisation.uuid); + + uuid.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + TextView tv = v.findViewById(R.id.material_preference_subtitle); + Snackbar.make(rootLayout, "clicked: " + tv.getText().toString(), Snackbar.LENGTH_LONG).show(); + } + }); + + MaterialPreferenceText nationality = findViewById(R.id.nationality); + nationality.setSubText(organisation.nationality); + + MaterialPreferenceText sector = findViewById(R.id.sector); + sector.setSubText(organisation.sector); + + MaterialPreferenceText description = findViewById(R.id.description); + description.setSubText(organisation.description); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu_profile, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + if (item.getItemId() == R.id.menu_delete_profile) { + clearDeviceAndLogOut(); + } + + return super.onOptionsItemSelected(item); + } + + private View.OnClickListener onFabClicked() { + return new View.OnClickListener() { + @Override + public void onClick(View v) { + fab.setImageDrawable(fabLoadingDrawable); + fabLoadingDrawable.start(); + updateProfile(); + } + }; + } + + private Drawable getRandomHeader() { + int[] ids = {R.drawable.ic_bank_note, R.drawable.ic_polka_dots, R.drawable.ic_wiggle, R.drawable.ic_circuit_board}; + return getDrawable(ids[new Random().nextInt(ids.length)]); + } + + public void updateProfile() { +// progressBar.setVisibility(View.VISIBLE); + + mispRestClient.getMyUser(new MispRestClient.UserCallback() { + @Override + public void success(final User user) { + + preferenceManager.setUserInfo(user); + + mispRestClient.getOrganisation(user.org_id, new MispRestClient.OrganisationCallback() { + @Override + public void success(Organisation organisation) { + fabLoadingDrawable.stop(); + preferenceManager.setUserOrgInfo(organisation); + } + + @Override + public void failure(String error) { + fabLoadingDrawable.stop(); + Snackbar.make(rootLayout, error, Snackbar.LENGTH_LONG).show(); + } + }); + } + + @Override + public void failure(String error) { + fabLoadingDrawable.stop(); + Snackbar.make(rootLayout, error, Snackbar.LENGTH_LONG).show(); + } + }); + } + + private void clearDeviceAndLogOut() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + + builder.setTitle("Clear all saved data and logout"); + builder.setMessage("Do you really want to delete all data and logout?"); + builder.setNegativeButton("Discard", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.cancel(); + } + }); + + builder.setPositiveButton("Delete & Logout", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + PreferenceManager prefs = PreferenceManager.getInstance(getApplicationContext()); + prefs.clearAllData(); + KeyStoreWrapper.deleteAllStoredKeys(); + + Intent login = new Intent(getApplicationContext(), LoginActivity.class); + startActivity(login); + finish(); + } + }); + + builder.create().show(); + } +} diff --git a/app/src/main/java/lu/circl/mispbump/activities/SyncActivity.java b/app/src/main/java/lu/circl/mispbump/activities/SyncActivity.java index 38517b5..160a368 100644 --- a/app/src/main/java/lu/circl/mispbump/activities/SyncActivity.java +++ b/app/src/main/java/lu/circl/mispbump/activities/SyncActivity.java @@ -2,6 +2,7 @@ package lu.circl.mispbump.activities; import android.graphics.Bitmap; import android.os.Bundle; +import android.support.design.bottomappbar.BottomAppBar; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; @@ -68,22 +69,22 @@ public class SyncActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_sync); + setContentView(R.layout.activity_sync_2); - Toolbar myToolbar = findViewById(R.id.appbar); - setSupportActionBar(myToolbar); +// BottomAppBar myToolbar = findViewById(R.id.bottomNavigation); +// setSupportActionBar(myToolbar); +// +// ActionBar ab = getSupportActionBar(); +// if (ab != null) { +// ab.setDisplayHomeAsUpEnabled(true); +// } - ActionBar ab = getSupportActionBar(); - if (ab != null) { - ab.setDisplayHomeAsUpEnabled(true); - } - - layout = findViewById(R.id.layout); + layout = findViewById(R.id.rootLayout); qrCodeView = findViewById(R.id.qrcode); - continueButton = findViewById(R.id.continue_fab); - continueButton.setOnClickListener(onContinueClicked); - continueButton.hide(); +// continueButton = findViewById(R.id.fab); +// continueButton.setOnClickListener(onContinueClicked); +// continueButton.hide(); diffieHellman = DiffieHellman.getInstance(); restClient = new MispRestClient(this); @@ -182,7 +183,7 @@ public class SyncActivity extends AppCompatActivity { new DialogManager.IDialogFeedback() { @Override public void positive() { - uploadInformation.remote = remoteSyncInfo; + uploadInformation.setRemote(remoteSyncInfo); continueButton.show(); } @@ -215,7 +216,7 @@ public class SyncActivity extends AppCompatActivity { @Override public void available() { - restClient.addOrganisation(uploadInformation.remote.organisation, new MispRestClient.OrganisationCallback() { + restClient.addOrganisation(uploadInformation.getRemote().organisation, new MispRestClient.OrganisationCallback() { @Override public void success(final Organisation organisation) { // create syncUser object from syncInfo @@ -227,8 +228,8 @@ public class SyncActivity extends AppCompatActivity { String emailSaveOrgName = organisation.name.replace(" ", "").toLowerCase(); syncUser.email = "syncuser_" + emailSaveOrgName + "@misp.de"; - syncUser.password = uploadInformation.remote.syncUserPassword; - syncUser.authkey = uploadInformation.remote.syncUserAuthkey; + syncUser.password = uploadInformation.getRemote().syncUserPassword; + syncUser.authkey = uploadInformation.getRemote().syncUserAuthkey; syncUser.termsaccepted = true; // add user to local organisation @@ -237,9 +238,9 @@ public class SyncActivity extends AppCompatActivity { public void success(User user) { Server server = new Server(); server.name = organisation.name + "'s Sync Server"; - server.url = uploadInformation.remote.baseUrl; + server.url = uploadInformation.getRemote().baseUrl; server.remote_org_id = organisation.id; - server.authkey = uploadInformation.local.syncUserAuthkey; + server.authkey = uploadInformation.getLocal().syncUserAuthkey; server.self_signed = true; restClient.addServer(server, new MispRestClient.ServerCallback() { @@ -253,14 +254,14 @@ public class SyncActivity extends AppCompatActivity { @Override public void success(Server server) { - uploadInformation.currentSyncStatus = UploadInformation.SyncStatus.COMPLETE; + uploadInformation.setCurrentSyncStatus(UploadInformation.SyncStatus.COMPLETE); preferenceManager.setUploadInformation(uploadInformation); finish(); } @Override public void failure(String error) { - uploadInformation.currentSyncStatus = UploadInformation.SyncStatus.FAILURE; + uploadInformation.setCurrentSyncStatus(UploadInformation.SyncStatus.FAILURE); preferenceManager.setUploadInformation(uploadInformation); Snackbar.make(layout, error, Snackbar.LENGTH_LONG).show(); Log.e(TAG, error); @@ -270,7 +271,7 @@ public class SyncActivity extends AppCompatActivity { @Override public void failure(String error) { - uploadInformation.currentSyncStatus = UploadInformation.SyncStatus.FAILURE; + uploadInformation.setCurrentSyncStatus(UploadInformation.SyncStatus.FAILURE); preferenceManager.setUploadInformation(uploadInformation); Snackbar.make(layout, error, Snackbar.LENGTH_LONG).show(); Log.e(TAG, error); @@ -280,7 +281,7 @@ public class SyncActivity extends AppCompatActivity { @Override public void failure(String error) { - uploadInformation.currentSyncStatus = UploadInformation.SyncStatus.FAILURE; + uploadInformation.setCurrentSyncStatus(UploadInformation.SyncStatus.FAILURE); preferenceManager.setUploadInformation(uploadInformation); Snackbar.make(layout, error, Snackbar.LENGTH_LONG).show(); Log.e(TAG, error); diff --git a/app/src/main/java/lu/circl/mispbump/adapters/SyncAdapter.java b/app/src/main/java/lu/circl/mispbump/adapters/SyncAdapter.java index e513ad2..b7a1a40 100644 --- a/app/src/main/java/lu/circl/mispbump/adapters/SyncAdapter.java +++ b/app/src/main/java/lu/circl/mispbump/adapters/SyncAdapter.java @@ -1,64 +1,87 @@ package lu.circl.mispbump.adapters; +import android.content.Context; +import android.content.Intent; import android.support.annotation.NonNull; +import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; +import android.widget.Toast; import java.util.List; import lu.circl.mispbump.R; +import lu.circl.mispbump.activities.HomeActivity; +import lu.circl.mispbump.activities.ProfileActivity; import lu.circl.mispbump.models.UploadInformation; public class SyncAdapter extends RecyclerView.Adapter { + private Context context; private List uploadInformationList; static class SyncViewHolder extends RecyclerView.ViewHolder { - TextView title, status; + TextView orgName, date; + ImageView syncStatus; ImageButton retry, delete; - SyncViewHolder(View v) { + SyncViewHolder(View v, final Context context) { super(v); - title = v.findViewById(R.id.title); - status = v.findViewById(R.id.syncStatus); + orgName = v.findViewById(R.id.orgName); + date = v.findViewById(R.id.date); - retry = v.findViewById(R.id.retry_button); - delete = v.findViewById(R.id.delete_button); + syncStatus = v.findViewById(R.id.syncStatus); + + retry = v.findViewById(R.id.retryButton); + delete = v.findViewById(R.id.deleteButton); + + v.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // context.startActivity(new Intent(context, ProfileActivity.class)); + } + }); } } - public SyncAdapter(List uploadInformationList) { + public SyncAdapter(List uploadInformationList, Context context) { this.uploadInformationList = uploadInformationList; + this.context = context; } @NonNull @Override public SyncViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { - View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.viewholder_sync, viewGroup, false); - return new SyncViewHolder(v); + View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.viewholder_sync_card, viewGroup, false); + return new SyncViewHolder(v, context); } @Override public void onBindViewHolder(@NonNull SyncViewHolder syncViewHolder, int i) { - syncViewHolder.title.setText(uploadInformationList.get(i).remote.organisation.name); - switch (uploadInformationList.get(i).currentSyncStatus) { + syncViewHolder.orgName.setText(uploadInformationList.get(i).getRemote().organisation.name); + syncViewHolder.date.setText(uploadInformationList.get(i).getDateString()); + + switch (uploadInformationList.get(i).getCurrentSyncStatus()) { case COMPLETE: - syncViewHolder.status.setText("Synced"); + syncViewHolder.syncStatus.setBackgroundColor(context.getColor(R.color.status_green)); + syncViewHolder.syncStatus.setImageResource(R.drawable.ic_check); syncViewHolder.retry.setVisibility(View.GONE); break; case FAILURE: - syncViewHolder.status.setText("Error"); + syncViewHolder.syncStatus.setBackgroundColor(context.getColor(R.color.status_red)); + syncViewHolder.syncStatus.setImageResource(R.drawable.ic_error_outline); syncViewHolder.retry.setVisibility(View.VISIBLE); break; case PENDING: - syncViewHolder.status.setText("Pending"); + syncViewHolder.syncStatus.setBackgroundColor(context.getColor(R.color.status_green)); syncViewHolder.retry.setVisibility(View.GONE); break; } diff --git a/app/src/main/java/lu/circl/mispbump/auxiliary/TileDrawable.kt b/app/src/main/java/lu/circl/mispbump/auxiliary/TileDrawable.kt new file mode 100644 index 0000000..c51c535 --- /dev/null +++ b/app/src/main/java/lu/circl/mispbump/auxiliary/TileDrawable.kt @@ -0,0 +1,49 @@ +package lu.circl.mispbump.auxiliary + +import android.graphics.Bitmap +import android.graphics.BitmapShader +import android.graphics.Canvas +import android.graphics.ColorFilter +import android.graphics.Paint +import android.graphics.PixelFormat +import android.graphics.Shader +import android.graphics.drawable.BitmapDrawable +import android.graphics.drawable.Drawable + +class TileDrawable(drawable: Drawable, tileMode: Shader.TileMode) : Drawable() { + + private val paint: Paint + + init { + paint = Paint().apply { + shader = BitmapShader(getBitmap(drawable), tileMode, tileMode) + } + } + + override fun draw(canvas: Canvas) { + canvas.drawPaint(paint) + } + + override fun setAlpha(alpha: Int) { + paint.alpha = alpha + } + + override fun getOpacity() = PixelFormat.TRANSLUCENT + + override fun setColorFilter(colorFilter: ColorFilter?) { + paint.colorFilter = colorFilter + } + + private fun getBitmap(drawable: Drawable): Bitmap { + if (drawable is BitmapDrawable) { + return drawable.bitmap + } + val bmp = Bitmap.createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, + Bitmap.Config.ARGB_8888) + val c = Canvas(bmp) + drawable.setBounds(0, 0, drawable.intrinsicWidth, drawable.intrinsicHeight) + drawable.draw(c) + return bmp + } + +} \ No newline at end of file diff --git a/app/src/main/java/lu/circl/mispbump/custom_views/MaterialPreferenceText.java b/app/src/main/java/lu/circl/mispbump/custom_views/MaterialPreferenceText.java new file mode 100644 index 0000000..7196361 --- /dev/null +++ b/app/src/main/java/lu/circl/mispbump/custom_views/MaterialPreferenceText.java @@ -0,0 +1,47 @@ +package lu.circl.mispbump.custom_views; + +import android.content.Context; +import android.content.res.TypedArray; +import android.support.constraint.ConstraintLayout; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import lu.circl.mispbump.R; + +public class MaterialPreferenceText extends ConstraintLayout { + + private View baseView; + private TextView title, subtitle; + + public MaterialPreferenceText(Context context, AttributeSet attrs) { + super(context, attrs); + + LayoutInflater inflater = LayoutInflater.from(context); + baseView = inflater.inflate(R.layout.material_preference_text, this); + + TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MaterialPreferenceText); + + ImageView icon = baseView.findViewById(R.id.material_preference_src); + icon.setImageResource(a.getResourceId(R.styleable.MaterialPreferenceText_pref_icon, 0x0)); + + title = baseView.findViewById(R.id.material_preference_title); + title.setText(a.getString(R.styleable.MaterialPreferenceText_text)); + + subtitle = baseView.findViewById(R.id.material_preference_subtitle); + subtitle.setText(a.getString(R.styleable.MaterialPreferenceText_subText)); + + a.recycle(); + } + + public void setSubText(String subText) { + subtitle.setText(subText); + } + +// @Override +// public void onClick(View v) { +// +// } +} diff --git a/app/src/main/java/lu/circl/mispbump/fragments/HomeFragment.java b/app/src/main/java/lu/circl/mispbump/fragments/HomeFragment.java new file mode 100644 index 0000000..a49bcc8 --- /dev/null +++ b/app/src/main/java/lu/circl/mispbump/fragments/HomeFragment.java @@ -0,0 +1,8 @@ +package lu.circl.mispbump.fragments; + +import android.support.v4.app.Fragment; + +public class HomeFragment extends Fragment { + + +} diff --git a/app/src/main/java/lu/circl/mispbump/models/UploadInformation.java b/app/src/main/java/lu/circl/mispbump/models/UploadInformation.java index b61b4ae..7b3222c 100644 --- a/app/src/main/java/lu/circl/mispbump/models/UploadInformation.java +++ b/app/src/main/java/lu/circl/mispbump/models/UploadInformation.java @@ -1,5 +1,10 @@ package lu.circl.mispbump.models; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + public class UploadInformation { public enum SyncStatus { @@ -8,20 +13,62 @@ public class UploadInformation { PENDING } - public SyncStatus currentSyncStatus = SyncStatus.PENDING; - public SyncInformation local; - public SyncInformation remote; + private SyncStatus currentSyncStatus = SyncStatus.PENDING; + + private SyncInformation local; + private SyncInformation remote; + + private Date date; public UploadInformation() { + this(null, null); } public UploadInformation(SyncInformation local) { - this.local = local; + this(local, null); } public UploadInformation(SyncInformation local, SyncInformation remote) { + date = Calendar.getInstance().getTime(); + this.local = local; this.remote = remote; + + date = Calendar.getInstance().getTime(); + } + + // getter and setter + + public void setCurrentSyncStatus(SyncStatus status) { + currentSyncStatus = status; + } + public SyncStatus getCurrentSyncStatus() { + return currentSyncStatus; + } + + public void setLocal(SyncInformation local) { + this.local = local; + } + public SyncInformation getLocal() { + return local; + } + + public void setRemote(SyncInformation remote) { + this.remote = remote; + } + public SyncInformation getRemote() { + return remote; + } + + public void setDate(Date date) { + this.date = date; + } + public Date getDate() { + return date; + } + public String getDateString() { + SimpleDateFormat df = new SimpleDateFormat("dd.mm.yyyy", Locale.getDefault()); + return df.format(date); } } diff --git a/app/src/main/res/anim/fade_in.xml b/app/src/main/res/anim/fade_in.xml new file mode 100644 index 0000000..271b405 --- /dev/null +++ b/app/src/main/res/anim/fade_in.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fade_out.xml b/app/src/main/res/anim/fade_out.xml new file mode 100644 index 0000000..b0caf35 --- /dev/null +++ b/app/src/main/res/anim/fade_out.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/animator/rotation_cw.xml b/app/src/main/res/animator/rotation_cw.xml new file mode 100644 index 0000000..fdc9066 --- /dev/null +++ b/app/src/main/res/animator/rotation_cw.xml @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/app/src/main/res/drawable/animated_sync.xml b/app/src/main/res/drawable/animated_sync.xml new file mode 100644 index 0000000..575c7bb --- /dev/null +++ b/app/src/main/res/drawable/animated_sync.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_navigation_color_states.xml b/app/src/main/res/drawable/bottom_navigation_color_states.xml new file mode 100644 index 0000000..dde925c --- /dev/null +++ b/app/src/main/res/drawable/bottom_navigation_color_states.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_arrow_forward.xml b/app/src/main/res/drawable/ic_arrow_forward.xml new file mode 100644 index 0000000..25fb386 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_forward.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_bank_note.xml b/app/src/main/res/drawable/ic_bank_note.xml new file mode 100644 index 0000000..61b826e --- /dev/null +++ b/app/src/main/res/drawable/ic_bank_note.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/ic_circuit_board.xml b/app/src/main/res/drawable/ic_circuit_board.xml new file mode 100644 index 0000000..fb1d101 --- /dev/null +++ b/app/src/main/res/drawable/ic_circuit_board.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml new file mode 100644 index 0000000..0c8775c --- /dev/null +++ b/app/src/main/res/drawable/ic_close.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_code_black_24dp.xml b/app/src/main/res/drawable/ic_code_black_24dp.xml new file mode 100644 index 0000000..5817fac --- /dev/null +++ b/app/src/main/res/drawable/ic_code_black_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_description.xml b/app/src/main/res/drawable/ic_description.xml new file mode 100644 index 0000000..302bb4a --- /dev/null +++ b/app/src/main/res/drawable/ic_description.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_error_outline.xml b/app/src/main/res/drawable/ic_error_outline.xml new file mode 100644 index 0000000..93db179 --- /dev/null +++ b/app/src/main/res/drawable/ic_error_outline.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_language.xml b/app/src/main/res/drawable/ic_language.xml new file mode 100644 index 0000000..74bc279 --- /dev/null +++ b/app/src/main/res/drawable/ic_language.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_polka_dots.xml b/app/src/main/res/drawable/ic_polka_dots.xml new file mode 100644 index 0000000..30d036f --- /dev/null +++ b/app/src/main/res/drawable/ic_polka_dots.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_qrcode.xml b/app/src/main/res/drawable/ic_qrcode.xml new file mode 100644 index 0000000..b1092e9 --- /dev/null +++ b/app/src/main/res/drawable/ic_qrcode.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_qrcode_scan.xml b/app/src/main/res/drawable/ic_qrcode_scan.xml new file mode 100644 index 0000000..d740f75 --- /dev/null +++ b/app/src/main/res/drawable/ic_qrcode_scan.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml new file mode 100644 index 0000000..1397d37 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_sync_black_24dp.xml b/app/src/main/res/drawable/ic_sync_black_24dp.xml index 7ae478f..dd197a6 100644 --- a/app/src/main/res/drawable/ic_sync_black_24dp.xml +++ b/app/src/main/res/drawable/ic_sync_black_24dp.xml @@ -1,5 +1,18 @@ - - + + + + + + + diff --git a/app/src/main/res/drawable/ic_wiggle.xml b/app/src/main/res/drawable/ic_wiggle.xml new file mode 100644 index 0000000..0e3e6fa --- /dev/null +++ b/app/src/main/res/drawable/ic_wiggle.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/layout/actionbar_home.xml b/app/src/main/res/layout/actionbar_home.xml deleted file mode 100644 index de0f835..0000000 --- a/app/src/main/res/layout/actionbar_home.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index 09d81f2..326f6bd 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -3,12 +3,11 @@ 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/layout" + android:id="@+id/rootLayout" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -17,95 +16,24 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" - android:elevation="0dp" + android:elevation="4dp" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> - - - - - - - - - - - - - - + + - - + android:gravity="center" + android:text="@string/no_syncs_hint"/> + android:src="@drawable/ic_qrcode_scan" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index dbba8f7..57fe8a2 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml new file mode 100644 index 0000000..dac2590 --- /dev/null +++ b/app/src/main/res/layout/activity_profile.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_sync.xml b/app/src/main/res/layout/activity_sync.xml index 110ebb2..7534f03 100644 --- a/app/src/main/res/layout/activity_sync.xml +++ b/app/src/main/res/layout/activity_sync.xml @@ -4,7 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/layout" + android:id="@+id/rootLayout" tools:context=".activities.SyncActivity" android:layout_height="match_parent" android:layout_width="match_parent"> diff --git a/app/src/main/res/layout/activity_sync_2.xml b/app/src/main/res/layout/activity_sync_2.xml new file mode 100644 index 0000000..478fc34 --- /dev/null +++ b/app/src/main/res/layout/activity_sync_2.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/material_preference_text.xml b/app/src/main/res/layout/material_preference_text.xml new file mode 100644 index 0000000..af6963b --- /dev/null +++ b/app/src/main/res/layout/material_preference_text.xml @@ -0,0 +1,48 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/viewholder_sync.xml b/app/src/main/res/layout/viewholder_sync.xml deleted file mode 100644 index 93e8677..0000000 --- a/app/src/main/res/layout/viewholder_sync.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/viewholder_sync_card.xml b/app/src/main/res/layout/viewholder_sync_card.xml new file mode 100644 index 0000000..f24cdec --- /dev/null +++ b/app/src/main/res/layout/viewholder_sync_card.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml index 7078251..3defc8b 100644 --- a/app/src/main/res/menu/main_menu.xml +++ b/app/src/main/res/menu/main_menu.xml @@ -3,12 +3,14 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> + android:id="@+id/menu_profile" + android:icon="@drawable/ic_person" + android:title="Profile" + app:showAsAction="ifRoom"/> - \ No newline at end of file diff --git a/app/src/main/res/menu/menu_bottom_navigation.xml b/app/src/main/res/menu/menu_bottom_navigation.xml deleted file mode 100644 index 3bc89ba..0000000 --- a/app/src/main/res/menu/menu_bottom_navigation.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/menu_profile.xml b/app/src/main/res/menu/menu_profile.xml new file mode 100644 index 0000000..8388c42 --- /dev/null +++ b/app/src/main/res/menu/menu_profile.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_sync.xml b/app/src/main/res/menu/menu_sync.xml new file mode 100644 index 0000000..7d4e56e --- /dev/null +++ b/app/src/main/res/menu/menu_sync.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index a918396..334b948 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -11,4 +11,5 @@ Das ist der Anmelde Informations Text. QR code Synchronisation + Sie haben noch keine MISP Instanzen verknüpft. \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..cd9ebf5 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 45ee7cb..7edfe8d 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,5 +3,13 @@ #047EB4 #023850 #12B3FA + #8012B3FA + #33000000 + + + #FFFFFF + #80FFFFFF + #4CAF50 + #E53935 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 281162b..fb42d72 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,4 +13,5 @@ Okay QR code Synchronization + You have not synced any MISP instances yet. diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ff6e2d8..8e591d9 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,4 +4,20 @@ @color/colorPrimaryDark @color/colorAccent + + + + + + diff --git a/build.gradle b/build.gradle index 02199bb..e0e9fa2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.3.31' repositories { google() jcenter() @@ -8,7 +9,8 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -18,7 +20,6 @@ allprojects { repositories { google() jcenter() - } }