1
0
mirror of https://codeberg.org/gitnex/GitNex synced 2024-12-23 08:58:12 +01:00

try to implement OpenWebRepoActivity

This commit is contained in:
6543 2019-09-06 01:01:46 +02:00
parent 7977aaa2be
commit 83e3564c13
No known key found for this signature in database
GPG Key ID: A1CA74D27FD13271
3 changed files with 39 additions and 0 deletions

View File

@ -34,6 +34,7 @@
<activity android:name=".activities.SponsorsActivity" />
<activity android:name=".activities.CreditsActivity" />
<activity android:name=".activities.CreateLabelActivity" />
<activity android:name=".activities.OpenWebRepoActivity" />
<activity android:name=".activities.CreateIssueActivity" />
<activity android:name=".activities.NewMilestoneActivity" />
<activity android:name=".activities.ReplyToIssueActivity" />

View File

@ -0,0 +1,29 @@
package org.mian.gitnex.activities;
import androidx.appcompat.app.AppCompatActivity;
/**
* Author 6543
*/
import android.view.View;
import org.mian.gitnex.util.TinyDB;
import android.content.Intent;
import android.net.Uri;
public class OpenWebRepoActivity extends AppCompatActivity implements View.OnClickListener {
@Override
public void onClick(View v) {
TinyDB tinyDb = new TinyDB(getApplicationContext());
String repoFullName = tinyDb.getString("repoFullName");
String instanceUrl = tinyDb.getString("instanceUrl");
String url = instanceUrl + "/" + repoFullName;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
}

View File

@ -29,6 +29,7 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
TextView createMilestone = v.findViewById(R.id.createNewMilestone);
TextView addCollaborator = v.findViewById(R.id.addCollaborator);
TextView createRelease = v.findViewById(R.id.createRelease);
TextView openWebRepo = v.findViewById(R.id.openWebRepo);
createLabel.setOnClickListener(new View.OnClickListener() {
@Override
@ -70,6 +71,14 @@ public class RepoBottomSheetFragment extends BottomSheetDialogFragment {
}
});
openWebRepo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bmListener.onButtonClicked("openWebRepo");
dismiss();
}
});
return v;
}