Skip to content

Commit

Permalink
add easy share log feature
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Oct 19, 2022
1 parent 1eb5282 commit 0c41e87
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/src/main/java/org/torproject/android/OrbotMainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,20 @@ private void doLayout() {
mPulsator = findViewById(R.id.pulsator);
tvVpnAppStatus = findViewById(R.id.tvVpnAppStatus);
findViewById(R.id.ivAppVpnSettings).setOnClickListener(v -> startActivityForResult(new Intent(OrbotMainActivity.this, AppManagerActivity.class), REQUEST_VPN_APPS_SELECT));


View mBtnShareLog = findViewById(R.id.btn_share);
mBtnShareLog.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT,mTxtOrbotLog.getText());
intent.setType("text/plain");
startActivity(intent);

}
});
}

private String getTorVersion () {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_share.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#000000" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>
19 changes: 18 additions & 1 deletion app/src/main/res/layout/layout_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,28 @@
android:orientation="vertical"
android:padding="6dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="0dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/menu_log"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_alignParentStart="true"
/>

<ImageButton
android:id="@+id/btn_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_share"
android:layout_alignParentEnd="true"
/>
</RelativeLayout>


<TextView
android:id="@+id/orbotLog"
Expand Down

0 comments on commit 0c41e87

Please sign in to comment.