try to implement OpenWebRepoActivity
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user