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.
|
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:id="@+id/widget"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="6dip"
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/build_info"
|
android:id="@+id/block1x1"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="80dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:gravity="left"
|
android:orientation="vertical"
|
||||||
style="@style/Text.BuildInfo.Fancy"
|
android:gravity="center"
|
||||||
android:textSize="18dip"
|
>
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/build_changelist"
|
android:id="@+id/build_info"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="left"
|
android:gravity="center"
|
||||||
android:layout_marginTop="4dip"
|
style="@style/Text.BuildInfo.Fancy"
|
||||||
style="@style/Text.BuildInfo.Fancy"
|
android:textSize="18dip"
|
||||||
android:textSize="9dip"
|
/>
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:id="@+id/build_date"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
style="@style/Text.BuildInfo.Fancy"
|
||||||
|
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"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<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"
|
<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:minHeight="72dip"
|
||||||
android:updatePeriodMillis="0"
|
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.content.res.Resources;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.text.format.DateUtils;
|
||||||
import android.text.format.Time;
|
import android.text.format.Time;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
@@ -69,12 +70,11 @@ public class BuildWidget extends AppWidgetProvider {
|
|||||||
0 /* no flags */);
|
0 /* no flags */);
|
||||||
updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent);
|
updateViews.setOnClickPendingIntent(R.id.widget, pendingIntent);
|
||||||
|
|
||||||
updateViews.setTextViewText(R.id.build_info,
|
updateViews.setTextViewText(R.id.build_info, android.os.Build.ID);
|
||||||
android.os.Build.VERSION.CODENAME + " " +
|
updateViews.setTextViewText(R.id.build_date,
|
||||||
android.os.Build.ID);
|
DateUtils.formatDateTime(context, android.os.Build.TIME,
|
||||||
updateViews.setTextViewText(R.id.build_changelist,
|
DateUtils.FORMAT_NUMERIC_DATE));
|
||||||
android.os.Build.FINGERPRINT
|
updateViews.setTextViewText(R.id.build_extra, android.os.Build.FINGERPRINT);
|
||||||
);
|
|
||||||
return updateViews;
|
return updateViews;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user