Reduce build widget footprint to 1x1.
Default footprint, that is. Change-Id: Ic8cdd0f97065291837b39bb79585fb86bdf23644
This commit is contained in:
@@ -14,31 +14,64 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/widget"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/block1x1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="6dip"
|
||||
android:gravity="center"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/build_info"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:gravity="center"
|
||||
style="@style/Text.BuildInfo.Fancy"
|
||||
android:textSize="18dip"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/build_changelist"
|
||||
android:layout_width="fill_parent"
|
||||
android:id="@+id/build_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:layout_marginTop="4dip"
|
||||
android:gravity="center"
|
||||
style="@style/Text.BuildInfo.Fancy"
|
||||
android:textSize="9dip"
|
||||
android:textSize="14dip"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/block1x1"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/build_extra"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:gravity="left|center_vertical"
|
||||
android:minWidth="60dp"
|
||||
style="@style/Text.BuildInfo.Fancy"
|
||||
android:textSize="10dip"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/platlogo"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="3dp"
|
||||
android:src="@*android:drawable/platlogo"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_weight="0"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -15,7 +15,12 @@
|
||||
-->
|
||||
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:minWidth="150dip"
|
||||
android:minResizeWidth="72dip"
|
||||
android:minResizeHeight="72dip"
|
||||
android:minWidth="72dip"
|
||||
android:minHeight="72dip"
|
||||
android:updatePeriodMillis="0"
|
||||
android:initialLayout="@layout/widget" />
|
||||
android:initialLayout="@layout/widget"
|
||||
android:resizeMode="horizontal"
|
||||
/>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.IBinder;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.format.Time;
|
||||
import android.util.Log;
|
||||
import android.widget.RemoteViews;
|
||||
@@ -69,12 +70,11 @@ public class BuildWidget extends AppWidgetProvider {
|
||||
0 /* no flags */);
|
||||
updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent);
|
||||
|
||||
updateViews.setTextViewText(R.id.build_info,
|
||||
android.os.Build.VERSION.CODENAME + " " +
|
||||
android.os.Build.ID);
|
||||
updateViews.setTextViewText(R.id.build_changelist,
|
||||
android.os.Build.FINGERPRINT
|
||||
);
|
||||
updateViews.setTextViewText(R.id.build_info, android.os.Build.ID);
|
||||
updateViews.setTextViewText(R.id.build_date,
|
||||
DateUtils.formatDateTime(context, android.os.Build.TIME,
|
||||
DateUtils.FORMAT_NUMERIC_DATE));
|
||||
updateViews.setTextViewText(R.id.build_extra, android.os.Build.FINGERPRINT);
|
||||
return updateViews;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user