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

Commit 4015b125 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Steve Kondik
Browse files

bluetooth: Materialize dialogs

Some dialogs imported from CAF are still using a Holo style, this
patch changes those to material and changes some layouts for better
usability:

1) Changes the enable dialog when something is shared via BT and it is off.
2) Changes the enabling progress dialog.
3) Removes a Toast (visible in screenshots)
4) Sets a transparent theme on the intent receiver, it's only a forwarding
   activity but it is up for enough time and shows a ugly incomplete view
   that immediately disappears.

Change-Id: Ia3f64f7d22a6486565df3035d22883e8d216dbe0
parent f8727c0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@
        </receiver>
        <activity android:name=".opp.BluetoothOppLauncherActivity"
            android:process="@string/process"
            android:theme="@android:style/Theme.Holo.Dialog"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:label="@string/bt_share_picker_label"
            android:enabled="@bool/profile_supported_opp">
            <intent-filter>
+13 −10
Original line number Diff line number Diff line
@@ -25,20 +25,23 @@
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        android:layout_height="match_parent"
        android:paddingStart="24dip"
        android:paddingTop="24dip"
        android:paddingEnd="24dip"
        android:paddingBottom="16dip"
        >

        <ProgressBar android:id="@+android:id/progress"
         <ProgressBar android:id="@android:id/progress"
             style="?android:attr/progressBarStyle"
             android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
             android:layout_height="wrap_content"
             android:indeterminate="true"
             android:layout_marginEnd="12dip" />

        <TextView
            android:id="@+id/progress_info"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dip"
            android:layout_marginEnd="20dip"
            android:layout_gravity="center_vertical"
            android:textAppearance="?android:attr/textAppearanceMedium" />
            style="@style/turning_on_item_text"/>

     </LinearLayout>

+1 −7
Original line number Diff line number Diff line
@@ -29,13 +29,7 @@

        <TextView
            android:id="@+id/content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dip"
            android:layout_marginEnd="20dip"
            android:gravity="center_horizontal"
            android:textAppearance="?android:attr/textAppearanceMedium" />

            style="@style/confirm_dialog_item_text" />
    </LinearLayout>

</ScrollView>
+21 −0
Original line number Diff line number Diff line
@@ -45,4 +45,25 @@
        <item name="android:textColor">@*android:color/primary_text_default_material_light</item>
    </style>

    <style name="confirm_dialog_item_text">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_marginStart">24dip</item>
        <item name="android:layout_marginEnd">24dip</item>
        <item name="android:layout_marginTop">24dip</item>
        <item name="android:layout_marginBottom">16dip</item>
        <item name="android:textAlignment">viewStart</item>
        <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
        <item name="android:textColor">@*android:color/secondary_text_default_material_light</item>
    </style>

    <style name="turning_on_item_text">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textAlignment">viewStart</item>
        <item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
        <item name="android:textColor">@*android:color/secondary_text_default_material_light</item>
        <item name="android:layout_gravity">center_vertical</item>
    </style>

</resources>
+2 −5
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public class BluetoothOppBtEnableActivity extends AlertActivity implements

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTheme(R.style.Theme_Material_Settings_Floating);
        super.onCreate(savedInstanceState);

        // Set up the "dialog"
@@ -75,8 +76,7 @@ public class BluetoothOppBtEnableActivity extends AlertActivity implements
    private View createView() {
        View view = getLayoutInflater().inflate(R.layout.confirm_dialog, null);
        TextView contentView = (TextView)view.findViewById(R.id.content);
        contentView.setText(getString(R.string.bt_enable_line1) + "\n\n"
                + getString(R.string.bt_enable_line2) + "\n");
        contentView.setText(getString(R.string.bt_enable_line2));

        return view;
    }
@@ -88,9 +88,6 @@ public class BluetoothOppBtEnableActivity extends AlertActivity implements
                mOppManager.mSendingFlag = true;
                mBtEnabled = true;

                Toast.makeText(this, getString(R.string.enabling_progress_content),
                        Toast.LENGTH_SHORT).show();

                Intent in = new Intent(this, BluetoothOppBtEnablingActivity.class);
                in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                this.startActivity(in);
Loading