sdm660-common: XiaomiParts: Add a preview image to kcal
This commit is contained in:
parent
d9cde63c35
commit
197013de2e
3 changed files with 21 additions and 2 deletions
BIN
XiaomiParts/res/drawable/preview.jpg
Normal file
BIN
XiaomiParts/res/drawable/preview.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 303 KiB |
18
XiaomiParts/res/layout/activity_kcal.xml
Normal file
18
XiaomiParts/res/layout/activity_kcal.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/preview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/preview" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/fragment_kcal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</LinearLayout>
|
|
@ -32,12 +32,13 @@ public class KCalSettingsActivity extends Activity implements Utils {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_kcal);
|
||||||
|
|
||||||
Fragment fragment = getFragmentManager().findFragmentById(android.R.id.content);
|
Fragment fragment = getFragmentManager().findFragmentById(R.id.fragment_kcal);
|
||||||
if (fragment == null) {
|
if (fragment == null) {
|
||||||
mKCalSettingsFragment = new KCalSettings();
|
mKCalSettingsFragment = new KCalSettings();
|
||||||
getFragmentManager().beginTransaction()
|
getFragmentManager().beginTransaction()
|
||||||
.add(android.R.id.content, mKCalSettingsFragment)
|
.add(R.id.fragment_kcal, mKCalSettingsFragment)
|
||||||
.commit();
|
.commit();
|
||||||
} else {
|
} else {
|
||||||
mKCalSettingsFragment = (KCalSettings) fragment;
|
mKCalSettingsFragment = (KCalSettings) fragment;
|
||||||
|
|
Loading…
Reference in a new issue