Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39d59c73 authored by Matt Casey's avatar Matt Casey
Browse files

Remove share button from clipboard edit activity

Redundant with clipboard overlay.
Updated layout constraints a bit to adjust for this.

Bug: 227756946
Test: Manual inspection.
Change-Id: Ie114a66a97fade4c691eedb5a4395bfa619e3397
parent ca6ef912
Loading
Loading
Loading
Loading
+5 −21
Original line number Diff line number Diff line
@@ -28,32 +28,16 @@
        app:layout_constraintStart_toStartOf="@id/done_button"
        app:layout_constraintTop_toBottomOf="@id/done_button" />

    <ImageButton
        android:id="@+id/share"
        style="@android:style/Widget.Material.Button.Borderless"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:padding="12dp"
        android:scaleType="fitCenter"
        android:contentDescription="@*android:string/share"
        android:tooltipText="@*android:string/share"
        android:layout_marginEnd="16dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/done_button"
        android:tint="?android:attr/textColorPrimary"
        android:src="@drawable/ic_screenshot_share" />

    <ScrollView
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="8dp"
        android:layout_marginStart="4dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintStart_toStartOf="@id/attribution"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/attribution"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintStart_toStartOf="@id/done_button"
        app:layout_constraintEnd_toEndOf="@id/share"
        app:layout_constraintTop_toBottomOf="@id/attribution">
    >

        <EditText
            android:id="@+id/edit_text"
+0 −12
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.app.Activity;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.ClipboardManager;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.PersistableBundle;
@@ -51,7 +50,6 @@ public class EditTextActivity extends Activity
        super.onCreate(savedInstanceState);
        setContentView(R.layout.clipboard_edit_text_activity);
        findViewById(R.id.done_button).setOnClickListener((v) -> saveToClipboard());
        findViewById(R.id.share).setOnClickListener((v) -> share());
        mEditText = findViewById(R.id.edit_text);
        mAttribution = findViewById(R.id.attribution);
        mClipboardManager = requireNonNull(getSystemService(ClipboardManager.class));
@@ -106,16 +104,6 @@ public class EditTextActivity extends Activity
        finish();
    }

    private void share() {
        Intent sendIntent = new Intent();
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, mEditText.getText().toString());
        sendIntent.setType("text/plain");

        Intent shareIntent = Intent.createChooser(sendIntent, null);
        startActivity(shareIntent);
    }

    private void hideIme() {
        InputMethodManager imm = getSystemService(InputMethodManager.class);
        imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0);