diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index d5af6efa8ebe9df006a23b78a4a15efbf33ff0f8..aff8ae78b09da8749bec4502f5cb9c82cd606920 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -14,8 +14,8 @@ <option name="values"> <map> <entry key="assetSourceType" value="FILE" /> - <entry key="outputName" value="ic_clear_cache" /> - <entry key="sourceFile" value="$PROJECT_DIR$/../DisIcons/clear_cache.svg" /> + <entry key="outputName" value="ic_note" /> + <entry key="sourceFile" value="$PROJECT_DIR$/../DisIcons/ic_note.svg" /> </map> </option> </PersistentState> diff --git a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java index c71227588fc88ac72d3ba1639d6520803fc3c557..6a601901e4f45ebf6b1ab2a09c149a0e0e8eb629 100644 --- a/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java +++ b/app/src/main/java/org/disroot/disrootapp/ui/MainActivity.java @@ -507,6 +507,32 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL }); + button = findViewById(R.id.NotesBtn);//NotesBtn + button.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + showNotesInfo(); + return true; + } + }); + button.setOnClickListener(new View.OnClickListener() { + public void onClick(View arg0) { + //first time tap check + if (firstStart.getBoolean("firsttap", true)){ + showFirstTap(); + firstStart.edit().putBoolean("firsttap", false).apply(); + return; + } + String NotesApp = "it.niedermann.owncloud.notes"; + Intent notes = getPackageManager().getLaunchIntentForPackage(NotesApp); + if(notes == null) { + showNotesDialog(); + return; + } + else startActivity(notes); + } + }); + button = findViewById(R.id.UserBtn);//UserBtn button.setOnLongClickListener(new View.OnLongClickListener() { @Override @@ -1043,6 +1069,43 @@ public class MainActivity extends AppCompatActivity implements View.OnLongClickL builder.show(); } + //There is no extra info about Nextcoud notes yet + private void showNotesInfo() { + final ScrollView dashboard = findViewById(R.id.dashboard); + AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); + builder.setCancelable(false); + builder.setTitle(R.string.NotesTitle); + builder.setMessage(getString(R.string.NotesInfo)); + builder.setPositiveButton(R.string.global_ok, null); + //builder.setNegativeButton(R.string.tell_more, new DialogInterface.OnClickListener() { + // @Override + // public void onClick(DialogInterface dialog, int which) { + // webView.loadUrl(Constants.URL_DisApp_NOTESHELP); + // webView.setVisibility(View.VISIBLE); + // dashboard.setVisibility(View.GONE); + // } + //}); + builder.show(); + } + private void showNotesDialog(){ + final ScrollView dashboard = findViewById(R.id.dashboard); + AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); + builder.setCancelable(false); + builder.setTitle(R.string.DiaInstallTitle); + builder.setMessage(getString(R.string.NotesDialog)); + builder.setPositiveButton(R.string.global_install, new DialogInterface.OnClickListener() { + String NotesApp = "it.niedermann.owncloud.notes"; + Intent notes = getPackageManager().getLaunchIntentForPackage(NotesApp); + @Override + public void onClick(DialogInterface dialog, int which) { + notes = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + NotesApp)); + startActivity(notes); + } + }); + builder.setNegativeButton(R.string.global_cancel , null); + builder.show(); + } + private void showUserInfo() { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setCancelable(false) diff --git a/app/src/main/res/drawable/ic_notes.xml b/app/src/main/res/drawable/ic_notes.xml new file mode 100644 index 0000000000000000000000000000000000000000..67351c03de54a12cf80e1b6a56451f9ee98c2a57 --- /dev/null +++ b/app/src/main/res/drawable/ic_notes.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:viewportHeight="48" + android:viewportWidth="48" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillAlpha="1" android:fillColor="#ffffff" + android:pathData="m12.625,30.625 l4.75,4.75L15.75,37L14,37L14,34L11,34L11,32.25ZM25.5625,18.4375c0.25,0.2188 0.1875,0.6563 -0.0938,0.9375L16.375,28.4688C16.0938,28.75 15.6563,28.8125 15.4375,28.5625 15.1875,28.3437 15.25,27.9062 15.5313,27.625L24.625,18.5312c0.2813,-0.2813 0.7188,-0.3438 0.9375,-0.0937zM17,40 L34,23 25,14 8,31v9zM27,12 L29.875,9.125c1.1563,-1.1563 1.1563,-3.0938 0,-4.25l-4.75,-4.75c-1.1563,-1.1563 -3.0938,-1.1563 -4.25,0L27,12ZM48,9v30c0,4.9688 -4.0313,9 -9,9L9,48C4.0313,48 0,43.9688 0,39L0,9C0,4.0313 4.0313,0 9,0h30c4.9688,0 9,4.0313 9,9z" android:strokeWidth="0.03125"/> +</vector> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 6ee336734f7512c86298c3611c0e24189ff42536..08d9d32addc443f319b14b72268872736f47844f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -194,13 +194,22 @@ android:gravity="center_horizontal" android:id="@+id/group4" android:layout_below="@+id/group3"> + <Button + android:id="@+id/NotesBtn" + style="?android:attr/borderlessButtonStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:maxWidth="24dp" + android:drawableTop="@drawable/ic_notes" + android:text="@string/action_notes" + android:textColor="#ffffff" /> <Button android:id="@+id/UserBtn" style="?android:attr/borderlessButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxWidth="24dp" - android:drawableTop="@drawable/ic_poll" + android:drawableTop="@drawable/ic_user" android:text="@string/action_user" android:textColor="#ffffff" /> @@ -224,15 +233,22 @@ android:text="@string/action_howto" android:textColor="#ffffff" /> - <Button - android:id="@+id/AboudBtn" - style="?android:attr/borderlessButtonStyle" - android:layout_width="wrap_content" + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" android:layout_height="wrap_content" - android:maxWidth="24dp" - android:drawableTop="@drawable/ic_about" - android:text="@string/action_about" - android:textColor="#ffffff" /> + android:id="@+id/group5" + android:layout_below="@+id/group4"><!-- android:gravity="center_horizontal" --> + <Button + android:id="@+id/AboudBtn" + style="?android:attr/borderlessButtonStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:maxWidth="24dp" + android:drawableTop="@drawable/ic_about" + android:text="@string/action_about" + android:textColor="#ffffff" /> </LinearLayout> </RelativeLayout> </ScrollView> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8891e516aa50391ea8f8a039fe452a53785e4d42..eec6abe57b433de1a645c83975bfafcd58fd1fa3 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -152,4 +152,8 @@ <string name="Scheduled">Scheduled</string> <string name="Investigating">Investigating</string> <string name="Identified">Identified</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5ee52b625763bf629b14dd0998b1c375adeaef2b..69a13f6505bd7e6cd3e9eaae8dbd250b4b246a46 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -181,4 +181,8 @@ <string name="Scheduled">Scheduled</string> <string name="Investigating">Investigating</string> <string name="Identified">Identified</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index aa525dbf284716bbc77f77077b31aebcc5bf4e4f..51f8a5eb5b4b33ebefa83d93f13e939c82d1e91a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -151,4 +151,8 @@ <string name="Scheduled">Pianificato</string> <string name="Investigating">Indagando</string> <string name="Identified">Identificato</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 6f55f670b62c2a02c8c45f2cec3b46bed41473bc..8e80b6250fe0f6f5f38136545b694200baff13df 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -152,4 +152,8 @@ <string name="Scheduled">Gepland</string> <string name="Investigating">Aan het onderzoeken</string> <string name="Identified">Geïdentificeerd</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index a0d059001c9c643c239092044563b0409fc42a52..714bbc516dba8893233f6f3bd6c6ed1ad93bdc93 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -151,4 +151,8 @@ <string name="Scheduled">Scheduled</string> <string name="Investigating">Investigating</string> <string name="Identified">Identified</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 2ce8c749fbd76c089e1c88c4211aaafca2375be6..a4c8758a4ce638d2598b8b18e6122dab90f649e7 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -152,4 +152,8 @@ <string name="Scheduled">Scheduled</string> <string name="Investigating">Investigating</string> <string name="Identified">Identified</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7608812c7de71e3b9e875fa7d988095f9ec74beb..c97ce269dd9cdc9a2f413d14b410f026ad8ddc27 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -152,4 +152,8 @@ <string name="Scheduled">Scheduled</string> <string name="Investigating">Investigating</string> <string name="Identified">Identified</string> + <string name="NotesTitle">Nextcloud Notes Info</string> + <string name="NotesInfo">The notes app is a distraction free notes taking app for Nextcloud</string> + <string name="NotesDialog">To continue you need to install Notes first.\nPlease select install to continue with the installatin on F-Droid.</string> + <string name="action_notes">Notes</string> </resources>