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

Commit c4789d15 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix tab layout for DSDA.

Use stock TextView which is properly centered instead of using a custom
view.

Change-Id: I6ddec449cfc7e00422183803cef8bd9d3ab87891
parent 4c8711fd
Loading
Loading
Loading
Loading
+0 −46
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *       with the distribution.
 *     * Neither the name of The Linux Foundation nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/tab_sub_info"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:background="@color/incall_background_color">

    <TextView
        android:id="@+id/tabSubText"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"/>

</LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@

    <color name="incall_action_bar_background_color">@color/incall_background_color</color>
    <color name="incall_action_bar_text_color">@color/incall_call_banner_text_color</color>
    <color name="incall_action_bar_tab_text_color">#000000</color>

    <color name="incall_photo_background_color">#545454</color>

+13 −0
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@
        <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item>
        <item name="android:popupMenuStyle">@style/InCallPopupMenuStyle</item>
        <item name="android:actionBarStyle">@style/InCallActionBarStyle</item>
        <item name="android:actionBarTabBarStyle">@style/InCallActionBarTabBarStyle</item>
        <item name="android:actionBarTabTextStyle">@style/InCallActionBarTabTextStyle</item>
        <item name="android:buttonStyleToggle">@style/InCallCompoundButton</item>
        <item name="android:alertDialogTheme">@android:style/Theme.Material.Light.Dialog.Alert</item>
    </style>
@@ -98,4 +100,15 @@
        <item name="android:textColor">@color/incall_action_bar_text_color</item>
    </style>

    <style name="InCallActionBarTabBarStyle" parent="@android:style/Widget.Material.ActionBar.TabBar">
        <item name="android:showDividers">none</item>
    </style>

    <style name="InCallActionBarTabTextStyle" parent="@android:style/Widget.Material.Light.ActionBar.TabText">
        <item name="android:textColor">@color/incall_action_bar_tab_text_color</item>
        <item name="android:textSize">14sp</item>
        <item name="android:fontFamily">sans-serif</item>
        <item name="android:elevation">0dp</item>
        <item name="android:textStyle">bold</item>
    </style>
</resources>
+2 −8
Original line number Diff line number Diff line
@@ -989,18 +989,12 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD
    private void initializeDsdaSwitchTab() {
        int phoneCount = InCallServiceImpl.sPhoneCount;
        ActionBar bar = getActionBar();
        View[] mDsdaTabLayout = new View[phoneCount];
        int[] subString = {R.string.sub_1, R.string.sub_2};

        Log.d(TAG, "initializeDsdaSwitchTab" + phoneCount);
        for (int i = 0; i < phoneCount; i++) {
            mDsdaTabLayout[i] = getLayoutInflater()
                    .inflate(R.layout.msim_tab_sub_info, null);

            ((TextView)mDsdaTabLayout[i].findViewById(R.id.tabSubText))
                    .setText(subString[i]);

            mDsdaTab[i] = bar.newTab().setCustomView(mDsdaTabLayout[i])
            mDsdaTab[i] = bar.newTab()
                    .setText(subString[i])
                    .setTabListener(new TabListener(i));
        }
    }