From b4c0745b407ce38a4380b34b317f956d8119735f Mon Sep 17 00:00:00 2001 From: M M Arif Date: Mon, 16 Sep 2019 20:28:34 +0500 Subject: [PATCH 1/5] reduce large links in branches and releases to small text with links. Signed-off-by: M M Arif --- .../org/mian/gitnex/adapters/BranchesAdapter.java | 7 +++++-- .../org/mian/gitnex/adapters/ReleasesAdapter.java | 12 ++++++++++-- app/src/main/res/layout/branches_list.xml | 2 -- app/src/main/res/layout/releases_list.xml | 4 ---- app/src/main/res/values-de/strings.xml | 4 ++++ app/src/main/res/values-fr/strings.xml | 4 ++++ app/src/main/res/values-ru/strings.xml | 4 ++++ app/src/main/res/values/strings.xml | 4 ++++ 8 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/adapters/BranchesAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/BranchesAdapter.java index 2534aa65..d9b11557 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/BranchesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/BranchesAdapter.java @@ -1,12 +1,13 @@ package org.mian.gitnex.adapters; import android.content.Context; +import android.text.Html; +import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import org.mian.gitnex.R; -import org.mian.gitnex.helpers.UrlHelper; import org.mian.gitnex.models.Branches; import org.mian.gitnex.util.TinyDB; import java.util.List; @@ -66,7 +67,9 @@ public class BranchesAdapter extends RecyclerView.Adapter" + mCtx.getResources().getString(R.string.commitLinkBranchesTab) + " ")); + holder.branchCommitHash.setMovementMethod(LinkMovementMethod.getInstance()); } diff --git a/app/src/main/java/org/mian/gitnex/adapters/ReleasesAdapter.java b/app/src/main/java/org/mian/gitnex/adapters/ReleasesAdapter.java index 51f9742c..e7d57a28 100644 --- a/app/src/main/java/org/mian/gitnex/adapters/ReleasesAdapter.java +++ b/app/src/main/java/org/mian/gitnex/adapters/ReleasesAdapter.java @@ -2,6 +2,8 @@ package org.mian.gitnex.adapters; import android.content.Context; import android.graphics.Color; +import android.text.Html; +import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -139,8 +141,14 @@ public class ReleasesAdapter extends RecyclerView.Adapter" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + " ")); + holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance()); + + holder.releaseTarDownload.setText( + Html.fromHtml("" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + " ")); + holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance()); } diff --git a/app/src/main/res/layout/branches_list.xml b/app/src/main/res/layout/branches_list.xml index df1db7f5..daa51cc0 100644 --- a/app/src/main/res/layout/branches_list.xml +++ b/app/src/main/res/layout/branches_list.xml @@ -36,10 +36,8 @@ android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textIsSelectable="true" android:textColor="@color/colorWhite" android:textSize="16sp" - android:autoLink="web" android:textColorLink="@color/lightBlue"/> diff --git a/app/src/main/res/layout/releases_list.xml b/app/src/main/res/layout/releases_list.xml index 08e26bfd..9e89a99b 100644 --- a/app/src/main/res/layout/releases_list.xml +++ b/app/src/main/res/layout/releases_list.xml @@ -83,10 +83,8 @@ android:layout_height="wrap_content" android:layout_marginTop="5dp" android:text="@string/releaseZip" - android:textIsSelectable="true" android:textColor="@color/colorWhite" android:textSize="16sp" - android:autoLink="web" android:textColorLink="@color/lightBlue"/> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4b3fa6cd..b66a6f24 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -404,6 +404,10 @@ Star Watcher + Commit + Zip Archive + Tar Archive + OK Fertig diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index e46158b5..fcf0afb9 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -404,6 +404,10 @@ Star Watcher + Commit + Zip Archive + Tar Archive + OK Done diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2e6e281f..892c9c92 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -404,6 +404,10 @@ Star Watcher + Commit + Zip Archive + Tar Archive + OK Готово diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 703a0bf4..c4d09afc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -441,6 +441,10 @@ Star Watcher + Commit + Zip Archive + Tar Archive + OK Done From c3da1900a0f522be4ac757f97b3cbc71b34077b2 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Tue, 17 Sep 2019 09:24:32 +0500 Subject: [PATCH 2/5] add donator to sponsor page, file icon --- .../org/mian/gitnex/activities/SponsorsActivity.java | 5 +++++ app/src/main/res/drawable/ic_file.xml | 5 +++++ app/src/main/res/layout/activity_sponsors.xml | 12 ++++++++++++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 23 insertions(+) create mode 100644 app/src/main/res/drawable/ic_file.xml diff --git a/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java b/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java index cb058a2f..8db47f6c 100644 --- a/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/SponsorsActivity.java @@ -2,8 +2,10 @@ package org.mian.gitnex.activities; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; +import android.text.method.LinkMovementMethod; import android.view.View; import android.widget.ImageView; +import android.widget.TextView; import org.mian.gitnex.R; /** @@ -20,6 +22,9 @@ public class SponsorsActivity extends AppCompatActivity { setContentView(R.layout.activity_sponsors); ImageView closeActivity = findViewById(R.id.close); + TextView liberaPaySponsorsThomas = findViewById(R.id.liberaPaySponsorsThomas); + + liberaPaySponsorsThomas.setMovementMethod(LinkMovementMethod.getInstance()); initCloseListener(); closeActivity.setOnClickListener(onClickListener); diff --git a/app/src/main/res/drawable/ic_file.xml b/app/src/main/res/drawable/ic_file.xml new file mode 100644 index 00000000..a431a5e9 --- /dev/null +++ b/app/src/main/res/drawable/ic_file.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_sponsors.xml b/app/src/main/res/layout/activity_sponsors.xml index e2e3f145..3673b1ab 100644 --- a/app/src/main/res/layout/activity_sponsors.xml +++ b/app/src/main/res/layout/activity_sponsors.xml @@ -73,6 +73,18 @@ android:text="@string/liberaPaySponsorsFabian" android:textColor="@color/white" android:textSize="16sp" + android:layout_marginBottom="10dp" + android:textColorLink="@color/lightBlue" + /> + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c4d09afc..6eb6ef48 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -407,6 +407,7 @@ Liberapay Fabian Stamm + Thomas Schneider @Fedilab From c38d249571f28c07cd855d8921dc6e244a83ff0a Mon Sep 17 00:00:00 2001 From: M M Arif Date: Tue, 17 Sep 2019 11:17:05 +0500 Subject: [PATCH 3/5] new file layout and bottomsheet link --- app/src/main/AndroidManifest.xml | 9 +- .../gitnex/activities/NewFileActivity.java | 22 ++ .../gitnex/activities/RepoDetailActivity.java | 4 +- .../fragments/RepoBottomSheetFragment.java | 9 + app/src/main/res/layout/activity_login.xml | 4 - app/src/main/res/layout/activity_new_file.xml | 189 ++++++++++++++++++ .../res/layout/repo_bottom_sheet_layout.xml | 12 ++ app/src/main/res/values/strings.xml | 32 ++- 8 files changed, 262 insertions(+), 19 deletions(-) create mode 100644 app/src/main/java/org/mian/gitnex/activities/NewFileActivity.java create mode 100644 app/src/main/res/layout/activity_new_file.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3b2337c4..036e310e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,8 +11,11 @@ android:supportsRtl="true" android:theme="@style/AppTheme"> + @@ -61,8 +64,8 @@ - - + + \ No newline at end of file diff --git a/app/src/main/java/org/mian/gitnex/activities/NewFileActivity.java b/app/src/main/java/org/mian/gitnex/activities/NewFileActivity.java new file mode 100644 index 00000000..f1881b5e --- /dev/null +++ b/app/src/main/java/org/mian/gitnex/activities/NewFileActivity.java @@ -0,0 +1,22 @@ +package org.mian.gitnex.activities; + +import android.os.Bundle; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import org.mian.gitnex.R; + +/** + * Author M M Arif + */ + +public class NewFileActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_new_file); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + } + +} diff --git a/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java b/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java index 02a227d3..0e845ef9 100644 --- a/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java @@ -108,7 +108,6 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS } } - @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); @@ -165,6 +164,9 @@ public class RepoDetailActivity extends AppCompatActivity implements RepoBottomS Intent i = new Intent(Intent.ACTION_VIEW, url); startActivity(i); break; + case "newFile": + startActivity(new Intent(RepoDetailActivity.this, NewFileActivity.class)); + break; } } diff --git a/app/src/main/java/org/mian/gitnex/fragments/RepoBottomSheetFragment.java b/app/src/main/java/org/mian/gitnex/fragments/RepoBottomSheetFragment.java index efa9ab81..c2866e1f 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/RepoBottomSheetFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/RepoBottomSheetFragment.java @@ -30,6 +30,7 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment { TextView addCollaborator = v.findViewById(R.id.addCollaborator); TextView createRelease = v.findViewById(R.id.createRelease); TextView openWebRepo = v.findViewById(R.id.openWebRepo); + TextView newFile = v.findViewById(R.id.newFile); createLabel.setOnClickListener(new View.OnClickListener() { @Override @@ -79,6 +80,14 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment { } }); + newFile.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + bmListener.onButtonClicked("newFile"); + dismiss(); + } + }); + return v; } diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 5a4a7c8e..15c882c4 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -61,7 +61,6 @@ android:padding="10dp" android:textSize="14sp" tools:ignore="Autofill" - android:labelFor="@+id/instance_url" android:background="@drawable/shape_inputs" android:drawableStart="@drawable/ic_link_24dp" android:drawablePadding="10dp" @@ -79,7 +78,6 @@ android:padding="10dp" android:textSize="14sp" tools:ignore="Autofill" - android:labelFor="@+id/login_uid" android:background="@drawable/shape_inputs" android:drawableStart="@drawable/ic_person_24dp" android:drawablePadding="10dp" @@ -97,7 +95,6 @@ android:padding="10dp" android:textSize="14sp" tools:ignore="Autofill" - android:labelFor="@+id/login_passwd" android:background="@drawable/shape_inputs" android:drawableStart="@drawable/ic_lock_24dp" android:drawablePadding="10dp" @@ -115,7 +112,6 @@ android:padding="10dp" android:textSize="14sp" tools:ignore="Autofill" - android:labelFor="@+id/otpCode" android:background="@drawable/shape_inputs" android:drawableStart="@drawable/ic_otp" android:drawablePadding="10dp" diff --git a/app/src/main/res/layout/activity_new_file.xml b/app/src/main/res/layout/activity_new_file.xml new file mode 100644 index 00000000..5eeb0f1c --- /dev/null +++ b/app/src/main/res/layout/activity_new_file.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +