deeplinks - Add button to open in browser

This commit is contained in:
M M Arif 2024-03-06 19:29:10 +05:00
parent e0209eb198
commit 6a8165507e
3 changed files with 28 additions and 11 deletions

View File

@ -42,6 +42,7 @@ public class DeepLinksActivity extends BaseActivity {
private Intent repoIntent;
private Intent orgIntent;
private Intent userIntent;
private Uri data;
@Override
public void onCreate(Bundle savedInstanceState) {
@ -58,7 +59,7 @@ public class DeepLinksActivity extends BaseActivity {
userIntent = new Intent(ctx, ProfileActivity.class);
Intent intent = getIntent();
Uri data = intent.getData();
data = intent.getData();
assert data != null;
// check for login
@ -699,6 +700,12 @@ public class DeepLinksActivity extends BaseActivity {
viewBinding.noActionFrame.setVisibility(View.VISIBLE);
viewBinding.addNewAccountFrame.setVisibility(View.GONE);
viewBinding.openInBrowserNoActionFrame.setOnClickListener(
noActionFrameOpenInBrowser -> {
AppUtil.openUrlInBrowser(this, String.valueOf(data));
finish();
});
viewBinding.repository.setOnClickListener(
repository -> {
tinyDB.putInt("defaultScreenId", 1);

View File

@ -12,7 +12,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
app:indicatorColor="?attr/progressIndicatorColor"/>
app:indicatorColor="?attr/progressIndicatorColor" />
<ScrollView
android:layout_width="match_parent"
@ -92,17 +92,27 @@
android:layout_height="wrap_content"
android:text="@string/noActionText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"/>
android:textSize="@dimen/dimen16sp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/openInBrowserNoActionFrame"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen24dp"
android:text="@string/openWebRepo"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/repository"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_marginTop="@dimen/dimen24dp"
android:layout_marginTop="@dimen/dimen8dp"
android:text="@string/navRepos"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold"/>
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/organization"
@ -112,7 +122,7 @@
android:text="@string/navOrg"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold"/>
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/notification"
@ -122,7 +132,7 @@
android:text="@string/pageTitleNotifications"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold"/>
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/explore"
@ -132,7 +142,7 @@
android:text="@string/pageTitleExplore"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold"/>
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/launchApp2"
@ -142,7 +152,7 @@
android:text="@string/launchApp"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold"/>
android:textStyle="bold" />
</LinearLayout>

View File

@ -742,9 +742,9 @@
<string name="prReopened">Pull Request reopened</string>
<string name="prMergeInfo">Pull Request Info</string>
<string name="accountDoesNotExist">It seems that account for URI %1$s does not exists in the app. You can add one by tapping on the Add New Account button.</string>
<string name="accountDoesNotExist">It seems that the account for URI %1$s does not exist in the app. You can add one by tapping on the Add New Account button.</string>
<string name="launchApp">Go to App</string>
<string name="noActionText">GitNex cannot handle the requested resource, you can open an issue at the project repository as an improvement with providing details of the work. Just launch a default screen for now from the buttons below, it can be changed from settings.</string>
<string name="noActionText">GitNex cannot handle the requested resource. You can open an issue at the project repository as an improvement, providing details of the work. Just launch a default screen for now from the buttons below; it can be changed from settings.</string>
<string name="biometricAuthTitle">Biometric Authentication</string>
<string name="biometricAuthSubTitle">Unlock using your biometric credentials</string>