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

Commit 8bf530ae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix partically truncated problem for bar chart"

parents b94548e5 ee7657f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -66,7 +66,7 @@
            android:id="@+id/bar_chart_details"
            android:id="@+id/bar_chart_details"
            style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"
            style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"
            android:layout_width="wrap_content"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_height="wrap_content"
            android:gravity="center"/>
            android:gravity="center"/>
    </LinearLayout>
    </LinearLayout>


+1 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@
<resources>
<resources>
    <style name="BarViewStyle">
    <style name="BarViewStyle">
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">226dp</item>
        <item name="android:layout_height">250dp</item>
        <item name="android:layout_weight">1</item>
        <item name="android:layout_weight">1</item>
        <item name="android:layout_marginStart">8dp</item>
        <item name="android:layout_marginStart">8dp</item>
        <item name="android:layout_marginEnd">8dp</item>
        <item name="android:layout_marginEnd">8dp</item>
+5 −5
Original line number Original line Diff line number Diff line
@@ -158,6 +158,11 @@ public class BarChartPreference extends Preference {
        holder.setDividerAllowedAbove(true);
        holder.setDividerAllowedAbove(true);
        holder.setDividerAllowedBelow(true);
        holder.setDividerAllowedBelow(true);


        // We bind title and details early so that we can preserve the correct height for chart
        // view.
        bindChartTitleView(holder);
        bindChartDetailsView(holder);

        // If the state is loading, we just show a blank view.
        // If the state is loading, we just show a blank view.
        if (mIsLoading) {
        if (mIsLoading) {
            holder.itemView.setVisibility(View.INVISIBLE);
            holder.itemView.setVisibility(View.INVISIBLE);
@@ -165,9 +170,6 @@ public class BarChartPreference extends Preference {
        }
        }
        holder.itemView.setVisibility(View.VISIBLE);
        holder.itemView.setVisibility(View.VISIBLE);


        // We must show title of bar chart.
        bindChartTitleView(holder);

        final BarViewInfo[] barViewInfos = mBarChartInfo.getBarViewInfos();
        final BarViewInfo[] barViewInfos = mBarChartInfo.getBarViewInfos();
        // If there is no any bar view, we just show an empty text.
        // If there is no any bar view, we just show an empty text.
        if (barViewInfos == null || barViewInfos.length == 0) {
        if (barViewInfos == null || barViewInfos.length == 0) {
@@ -175,8 +177,6 @@ public class BarChartPreference extends Preference {
            return;
            return;
        }
        }
        setEmptyViewVisible(holder, false /* visible */);
        setEmptyViewVisible(holder, false /* visible */);

        bindChartDetailsView(holder);
        updateBarChart(holder);
        updateBarChart(holder);
    }
    }