View with fill_parent between two content_wrap views - Android Software/Hacking General [Developers Only]

hi,
I want a ListView to fill the remaining available space after placing some other views at the top and bottom of the screen.
Take a look at the following layout:
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/widget37"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
>
<EditText
android:id="@+id/txtSearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textSize="18sp"
>
</EditText>
<Button
android:id="@+id/buttonGO"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Pesquisar"
>
</Button>
<ListView
android:id="@+id/resultlist"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<TextView
android:id="@+id/statusbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:text="Status ..."
/>
</LinearLayout>
I want the last TextView (statusbar) to remain at the bottom of the screen like a status bar, and I want the first EditText and Button to remain at the top of the screen. The ListView can fill all the remaining space.
Obviously this layout is not working, so can anyone help me?
Thanks

Related

DeskClockGoogle.apk won't display alarm times with framework-res bg set to image

I'm stuck, I've edited my framework-res.apk to use a background images most screens rather than simply colors. I changed <item name="windowBackground">@drawable/screen_background_dark</item> (which references the color black) under <style name="Theme"> to point to an image at @drawable/menu_bg. Example below:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For the very most part this has been a success, except for the alarms screen. My alarm screen became this:
If I return that value to black, everything works fine, white text displaying alarm times and days, etc. I went into DeskClockGoogle.apk and do some xml edits to set the black background behind the alarm on/off indicators to transparent, but the area to the right of that which displays the alarm times has no background setting to edit, and any attempts I make to add one ends up in a force closing alarms screen.
The two xmls responsible for this section of the screen are layout/alarm_clock and layout/alarm_time. Code from both is posted below:
alarm_clock.xml - the code in blue calls the list of alarms
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/base_layout" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="horizontal" android:id="@id/add_alarm" android:background="@android:drawable/list_selector_background" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:gravity="center" android:duplicateParentState="true" android:src="@drawable/add_alarm" android:scaleType="center" style="\@style/alarm_list_left_column" />
<TextView android:textAppearance="?android:textAppearanceLarge" android:textColor="?android:textColorPrimary" android:layout_gravity="center_vertical" android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/add_alarm" />
</LinearLayout>
<ImageView android:gravity="fill_horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@android:drawable/divider_horizontal_dark" android:scaleType="fitXY" />
<ListView android:id="@id/alarms_list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" />
[COLOR="Navy"]<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">[/COLOR]
<ImageButton android:id="@id/desk_clock_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_clock_strip_desk_clock" android:contentDescription="@string/desk_clock_button_description" style="\@style/ButtonStripLeft" />
<com.android.deskclock.DigitalClock android:layout_width="fill_parent" android:layout_height="fill_parent" style="\@style/ButtonStripRight">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="true">
<TextView android:textSize="48.0sp" android:textColor="?android:textColorPrimary" android:id="@id/timeDisplay" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorPrimary" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</com.android.deskclock.DigitalClock>
</LinearLayout>
</LinearLayout>
alarm_time.xml - displays alarm on/off indicators and alarm times, am/pm, label, days. Once again, blue code is area in question.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.deskclock.DontPressWithParentLayout android:gravity="center" android:orientation="vertical" android:id="@id/indicator" android:background="@drawable/clock_selector" style="\@style/alarm_list_left_column">
<CheckBox android:layout_gravity="center" android:id="@id/clock_onoff" android:background="@drawable/indicator_clock_onoff" android:focusable="false" android:clickable="false" android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@null" />
<ImageView android:layout_gravity="center" android:id="@id/bar_onoff" android:paddingTop="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_indicator_off" />
</com.android.deskclock.DontPressWithParentLayout>
<ImageView android:gravity="fill_vertical" android:background="?android:windowBackground" android:paddingTop="4.0dip" android:paddingBottom="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/divider_vertical_dark" android:scaleType="fitXY" />
[COLOR="Navy"]<com.android.deskclock.DigitalClock android:gravity="center_vertical" android:orientation="vertical" android:id="@id/digitalClock" android:paddingLeft="16.0dip" android:paddingRight="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="true">
<TextView android:textSize="28.0sp" android:textColor="?android:textColorPrimary" android:id="@id/timeDisplay" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:includeFontPadding="false" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorPrimary" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorTertiary" android:gravity="right" android:id="@id/label" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
<TextView android:textAppearance="?android:textAppearanceSmall" android:textColor="?android:textColorSecondary" android:id="@id/daysOfWeek" android:layout_width="fill_parent" android:layout_height="wrap_content" android:includeFontPadding="false" />
</com.android.deskclock.DigitalClock>[/COLOR]
</LinearLayout>
Any help would be appreciated.
Anyone else use background images instead of colors and run into this?
Sent from my Cool Blued 1.83 Atrix
I'm running into the same issue with my MattedBlues theme for the theme engine (on the market). I'm using a custom image for the background and it causes an issue with the Alarm Clock screen (only issue I've found thus far). I'm not even sure where to begin with fixing it.
OP: have you found a fix yet? Hopefully we can collaborate in fixing it if you haven't already. Thank you!
jimbush3 said:
I'm stuck, I've edited my framework-res.apk to use a background images most screens rather than simply colors. I changed <item name="windowBackground">@drawable/screen_background_dark</item> (which references the color black) under <style name="Theme"> to point to an image at @drawable/menu_bg. Example below:
For the very most part this has been a success, except for the alarms screen. My alarm screen became this:
If I return that value to black, everything works fine, white text displaying alarm times and days, etc. I went into DeskClockGoogle.apk and do some xml edits to set the black background behind the alarm on/off indicators to transparent, but the area to the right of that which displays the alarm times has no background setting to edit, and any attempts I make to add one ends up in a force closing alarms screen.
The two xmls responsible for this section of the screen are layout/alarm_clock and layout/alarm_time. Code from both is posted below:
alarm_clock.xml - the code in blue calls the list of alarms
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="vertical" android:id="@id/base_layout" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="horizontal" android:id="@id/add_alarm" android:background="@android:drawable/list_selector_background" android:focusable="true" android:clickable="true" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:gravity="center" android:duplicateParentState="true" android:src="@drawable/add_alarm" android:scaleType="center" style="\@style/alarm_list_left_column" />
<TextView android:textAppearance="?android:textAppearanceLarge" android:textColor="?android:textColorPrimary" android:layout_gravity="center_vertical" android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/add_alarm" />
</LinearLayout>
<ImageView android:gravity="fill_horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@android:drawable/divider_horizontal_dark" android:scaleType="fitXY" />
<ListView android:id="@id/alarms_list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" />
[COLOR="Navy"]<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">[/COLOR]
<ImageButton android:id="@id/desk_clock_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_clock_strip_desk_clock" android:contentDescription="@string/desk_clock_button_description" style="\@style/ButtonStripLeft" />
<com.android.deskclock.DigitalClock android:layout_width="fill_parent" android:layout_height="fill_parent" style="\@style/ButtonStripRight">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="true">
<TextView android:textSize="48.0sp" android:textColor="?android:textColorPrimary" android:id="@id/timeDisplay" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorPrimary" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</com.android.deskclock.DigitalClock>
</LinearLayout>
</LinearLayout>
alarm_time.xml - displays alarm on/off indicators and alarm times, am/pm, label, days. Once again, blue code is area in question.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.deskclock.DontPressWithParentLayout android:gravity="center" android:orientation="vertical" android:id="@id/indicator" android:background="@drawable/clock_selector" style="\@style/alarm_list_left_column">
<CheckBox android:layout_gravity="center" android:id="@id/clock_onoff" android:background="@drawable/indicator_clock_onoff" android:focusable="false" android:clickable="false" android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@null" />
<ImageView android:layout_gravity="center" android:id="@id/bar_onoff" android:paddingTop="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_indicator_off" />
</com.android.deskclock.DontPressWithParentLayout>
<ImageView android:gravity="fill_vertical" android:background="?android:windowBackground" android:paddingTop="4.0dip" android:paddingBottom="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/divider_vertical_dark" android:scaleType="fitXY" />
[COLOR="Navy"]<com.android.deskclock.DigitalClock android:gravity="center_vertical" android:orientation="vertical" android:id="@id/digitalClock" android:paddingLeft="16.0dip" android:paddingRight="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="true">
<TextView android:textSize="28.0sp" android:textColor="?android:textColorPrimary" android:id="@id/timeDisplay" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:includeFontPadding="false" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorPrimary" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorTertiary" android:gravity="right" android:id="@id/label" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
<TextView android:textAppearance="?android:textAppearanceSmall" android:textColor="?android:textColorSecondary" android:id="@id/daysOfWeek" android:layout_width="fill_parent" android:layout_height="wrap_content" android:includeFontPadding="false" />
</com.android.deskclock.DigitalClock>[/COLOR]
</LinearLayout>
Any help would be appreciated.
Click to expand...
Click to collapse
I CAN'T BELIEVE MY EYES!!!!
I thought i am the only one in this world to have that "MOST UNKNOWN" and strange problem, and now i coincidently got this thread!!! REALLY THIS PROBLEM MAKES ME MADDDD!!!
I made an awesome ICS themed rom for FroYo, but that DeskClock.apk is still unsolved bug in it, even after a month of try!! The same is the case, i set the menu background in style="Theme", in styles.xml, and that creates an EXACTLY same image as you got!!!!
SO WE ARE HERE ON SAME SH!T!!
Now, as far as my whole month of "RESEARCH" is concerned, the xml responsible for BG of that alarmtime, no. of days, label, etc is the RED line in--
layout/ALARM_TIME.XML:-
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.deskclock.DontPressWithParentLayout android:gravity="center" android:orientation="vertical" android:id="@id/indicator" android:background="@drawable/clock_selector" style="@style/alarm_list_left_column">
<CheckBox android:layout_gravity="center" android:id="@id/clock_onoff" android:background="@drawable/indicator_clock_onoff" android:focusable="false" android:clickable="false" android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@null" />
<ImageView android:layout_gravity="center" android:id="@id/bar_onoff" android:paddingTop="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_indicator_off" />
</com.android.deskclock.DontPressWithParentLayout>
[COLOR="Red"] <ImageView android:gravity="fill_vertical" android:background="#ffffffff" android:paddingTop="4.0dip" android:paddingBottom="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/divider_vertical_dark" android:scaleType="fitXY" />[/COLOR]
<com.android.deskclock.DigitalClock android:gravity="center_vertical" android:orientation="vertical" android:id="@id/digitalClock" android:paddingLeft="16.0dip" android:paddingRight="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1.0">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="true">
<TextView android:textSize="28.0sp" android:textColor="?android:textColorPrimary" android:id="@id/timeDisplay" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:includeFontPadding="false" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorPrimary" android:id="@id/am_pm" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textAppearance="?android:textAppearanceSmall" android:textStyle="bold" android:textColor="?android:textColorTertiary" android:gravity="right" android:id="@id/label" android:paddingLeft="8.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1.0" />
</LinearLayout>
<TextView android:textAppearance="?android:textAppearanceSmall" android:textColor="?android:textColorSecondary" android:id="@id/daysOfWeek" android:layout_width="fill_parent" android:layout_height="wrap_content" android:includeFontPadding="false" />
</com.android.deskclock.DigitalClock>
</LinearLayout>
If you see android:background in there, its #ffffffff i.e, white, which is the one i modded. Setting that to white solves the background bug, and everything is quite good and visible, but again,
IT F##**KS UP EVERYTHING AND I GET AN FC AS SOON AS I TOOGLE ALARM ON/OFF!!!!!!!!!!!!
This is what i've progressed uptill now!! YOU PLZ. TRY THAT AND TELL ME IF IT WORKED FOR YOU. ALSO, IF YOU GET ANOTHER SOLUTION, PLZ. PM ME!!!

[Help] bringing up a new page on button press

Hello, I am very new to app developing, and have started work on my first idea, however I have got stuck on pretty much on of the first steps .
So I have created the first page layout of 5 buttons, its pretty much just the standard UI until I have all the pages sorted etc. my problem is I can not work out how to have it so, when a button is pressed a new screen pops up with another set of buttons.
Any help would be great, or perhaps links to guides that can show me how to do this?
Below is the main java file and the xml layout.
Code:
package com.android.PhysicsUnit4Revision;
import android.app.Activity;
import android.os.Bundle;
public class PhysicsUnit4 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="horizontal">
<TableLayout android:id="@+id/tableLayout1" android:layout_height="fill_parent" android:layout_width="fill_parent">
<TextView android:text="A2 Physics Unit 4 Revision" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Button android:layout_width="fill_parent" android:text="Audio Revision" android:layout_height="wrap_content" android:id="@+id/audio"></Button>
<Button android:layout_width="wrap_content" android:text="Quiz" android:layout_height="wrap_content" android:id="@+id/quiz"></Button>
<Button android:layout_width="wrap_content" android:text="Past Paper Resources" android:layout_height="wrap_content" android:id="@+id/past"></Button>
<Button android:text="Definition list" android:id="@+id/definition" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="Checklist" android:id="@+id/checklist" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableLayout>
</LinearLayout>

[Q]How to delete the %album from the PlayerPro widget?

I'm working on a theme. It has widget theming options too, but when i launch the playerpro large widget with my file it say: "Widget loading problem". The preview vorks fine. The only thing i dont need is the album text. The code section before deleting the %album:
Code:
<LinearLayout android:gravity="center" android:orientation="vertical" android:id="@id/titles" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="12.0dip" android:layout_marginRight="12.0dip" android:layout_marginBottom="-76.0dip" android:layout_weight="0.0" android:layout_above="@id/appwidget_art_wrapper" android:layout_alignLeft="@id/appwidget_art_wrapper" android:layout_alignRight="@id/appwidget_art_wrapper" android:layout_centerHorizontal="true">
<TextView android:textSize="15.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:ellipsize="end" android:gravity="center" android:id="@id/artist" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:includeFontPadding="true" android:shadowColor="#ff000000" android:shadowDy="1.1" android:shadowRadius="1.1" />
<TextView android:textSize="18.0sp" android:textStyle="bold" android:textColor="#ffffffff" android:ellipsize="end" android:gravity="center" android:id="@id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/widget_initial_text" android:singleLine="true" android:includeFontPadding="true" android:shadowColor="#ff000000" android:shadowDy="1.1" android:shadowRadius="1.1" />
<TextView android:textSize="15.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:ellipsize="end" android:gravity="left" android:id="@id/album" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:includeFontPadding="true" android:shadowColor="#ff000000" android:shadowDy="1.1" android:shadowRadius="1.1" />
</LinearLayout>
What i tried:
Delete the last <TextView> section...
Problem:
The preview is just perfect, but the widget won't start at homescreen.
First of all, sorry for my bad english. Second of all, this probled driving me crasy, so if anyone have any idea, please... Save me from insanity... My theme is based on the Cloudy theme. Yes, i know that this is not the most fair thing in the whole world, but i make it for myself.

Guide/tutorial-statusbar clock-add seconds,day of week,date-full customiztion options

This guide will help you in customizing the statusbar clock and play with it a bit. This mod requires a deodexed LGSystemUI.apk. It took me about a month to cook this mod.This guide couldnt have been possible without @Ticklefish , so I thank him for his terrific knowledge and his willingness to help others.
Special thanks to @Spannaa for his guide based on which this one was made...Truly awesome both @Spannaa and @Ticklefish
Basically an inbuilt android function called "TEXTCLOCK" is used in the mod to display clock in html code
You need to have knowledge of compiling and decompiling ...Tools recommended:
Apktool 1.5.2 (coz it handles smali files perfectly, although we don't touch any of them in this mod)
Notepad++
Remember the variable used should be in format like :
<b>...</b> ..................................makes the the enclosed text bold
<i>...</i>...................................makes the the enclosed text italic
<font size=xx>...</font>............sets the font size of the enclosed text to X.0dip
<font fgcolor ="#ffffffff">...</>........sets the foreground colour of the enclosed text
<font bgcolor ="#ff000000">...</>... .sets the background colour of the enclosed text
fgcolor and bgcolor set the foreground and background color. Note that these attributes should be in hexcode like “#ff00ff00”.
<u>...</u>.... Underlines the text
<strike>...</strike>.... creates a strikethrough
Click to expand...
Click to collapse
There are lots of options for customizations available. You can change the strings above using any of the following.
d.............Day Of Month " 1"
dd.......... Day Of Month adds Zero before,"01"
EEEE......Day Of Week "Tuesday"
EEE........Week Day short "Tue"
MMMM....Month "SEPTEMBER"
MMM.......Month short "SEP"
MM..........Month adds zero before "09"
M............Month "9"
yyyy........Year "2014"
yy............Year Short "14"
h..............Hour 12 hour, 5
hh............Hour adds zero before "08"
H.............Hour 24 hour 5pm="5/17"
HH...........Hour 24 hour add zero before ie. 5am = "05"
In some ROMs if "HH" won't work replace the same with "kk" instead of "HH"
m.............Minute 5 min="5"
mm..........Minute add zero before 5min ="05"
s..............Second 7secs ="7"
ss............Second add zero before 7sec="07"
a..............AM/PM
Click to expand...
Click to collapse
Step 1
Decompile your LGSystemUI.apk. Edit /res/layout/statusbar.xml and find the line:
HTML:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
V.Imp: Do not delete this line...Just hide the clock by adding "andoid:visibility="gone""
Change it to
HTML:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="18.0dip" android:visibility="gone" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:paddingBottom="1.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Step 2
Just below that line add the following code:
HTML:
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
VVV IMP: The above line must be below the stock clock code or the statusbar will crash
Step 3
Open /res/values/strings and add the following strings at the end.
HTML:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm</string>
You can change this to what is mentioned before with your choice of clock format
Step 4
Open/res/values/styles and find
HTML:
<style name="TextAppearance.StatusBar.Clock" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">18.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
Here you can customize size.bold,colour of the clock
Step 5
Recompile your LGSystemUI.apk.
Copy meta_inf folder and AndroidManifest.xml from original file to recompiled file.
Rename the recompiled file as LGSystemUI.apk
Push to /system/priv-app with 644 permissions.
Reboot and enjoy the mod.
For eg. my strings read as follows:
HTML:
<string name="status_bar_clock_12hr_format"><font size="13">EEE, </font>h:mm:ss<font size="10"> a</font></string>
<string name="status_bar_clock_24hr_format"><font size="13">EEE, </font>HH:mm:ss</string>
Output of which is as under:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For those who arent profoud with compile/decompile...I am posting a G2 STOCK KK LGSystemUI.apk for download. It has
-Short day of the week.
-Clock with seconds
-Small am/pm
SCRRENSHOT:
Rename to LGSystemUI.apk and push to /system/priv-app with 644 permissions and delete the LGSystemUI.odex file.
Stock G2 KK Download
You have to play around a bit with the strings added to strings.xml in order to figure out your desired result
A lot of hardwork went into making this guide so please show appreciation by pressing thanks button. Please also give credit if youve used this in your MODS/ROM
thanks rastigo.
a clarification, if "HH" does not work, replace with "kk"
Very helpful!! Thanks!!
Thanks mate!!!
Great job
So I am finally testing this but have fun into an issue not sure what could have gone wrong, systemui is deodexed and the strings are there but 24 hour clock looks like this
And 12 hour clock same but last number changes
Any ideas @rastigo
XXZOMBIEPIKACHU WAS HERE
Share your strings.xml and statusbar.xml i will look and revert
rastigo said:
Share your strings.xml and statusbar.xml i will look and revert
Click to expand...
Click to collapse
It's okay I figured out what I was doing wrong, I was using textclock styles but had forgotten to install modded systemui with the strings for textclock added
XXZOMBIEPIKACHU WAS HERE
Yeah, possibilities are endless
rastigo said:
Yeah, possibilities are endless
Click to expand...
Click to collapse
so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?
XxZombiePikachu said:
so how did you get the clock and separate date? do you still apply visibility gone to the clock and use two textclock(one on left and one on right? or do you leave clock on right and remove it from the 12/24 hour format strings/place textclock on the left?
Click to expand...
Click to collapse
You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless
rastigo said:
You leave the original clock line untouched. Just remember to add the same clock line above textclock with visibility gone. Or systemui will crash. That way you have clock and the textclock with your string both. Remember to add the exact same clock line with visibility gone before each textclock.... Like i said possibilities are limitless
Click to expand...
Click to collapse
Well I left the center clock and added a clock(same code as center one) to the left with visibility gone and textclock and then used the format EEE, MMM/dd/yy but it still includes the clock
XXZOMBIEPIKACHU WAS HERE
Send me your statusbar.xml and strings.xml. Will see and revert
XxZombiePikachu said:
Well I left the center clock and added a clock(same code as center one) to the left with visibility gone and textclock and then used the format EEE, MMM/dd/yy but it still includes the clock
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
rastigo said:
Send me your statusbar.xml and strings.xml. Will see and revert
Click to expand...
Click to collapse
If you can include that xml in a post here, I can take a look for you as well if you want. :good:
rastigo said:
Send me your statusbar.xml and strings.xml. Will see and revert
Click to expand...
Click to collapse
Ticklefish said:
If you can include that xml in a post here, I can take a look for you as well if you want. :good:
Click to expand...
Click to collapse
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
XxZombiePikachu said:
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
Two clocks again, eh? This may just be caused the original clock line. If you can find that xml, I'm sure I'll be able to spot the problem for you. :highfive:
(Nice wallpaper, btw..)
Ticklefish said:
Two clocks again, eh? This may just be caused the original clock line. If you can find that xml, I'm sure I'll be able to spot the problem for you. :highfive:
(Nice wallpaper, btw..)
Click to expand...
Click to collapse
@XxZombiePikachu, Here are 2 workaround options , try and let me know if any of them works. I looked at your files, they seem fine to me but I dont know where is the second clock drawn from. Anyways @Ticklefish will figure out soon (he is the best with xml).
Meanwhile try the attached workarounds and let me know . Files are HERE
Ticklefish said:
(Nice wallpaper, btw..)
Click to expand...
Click to collapse
well mr@Ticklefish here you go, it is one of the g3 default wallpapers
rastigo said:
@XxZombiePikachu, Here are 2 workaround options , try and let me know if any of them works. I looked at your files, they seem fine to me but I dont know where is the second clock drawn from. Anyways @Ticklefish will figure out soon (he is the best with xml).
Meanwhile try the attached workarounds and let me know . Files are HERE
Click to expand...
Click to collapse
ok so workaround number one has the same result while workaround number two doesn't compile because you made an error in the status_bar.xml in line 26 you either forgot to finish the line or accidentally added that piece of code:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
I know i might have messed with the files in a hurry. Guess we have to wait for @Ticklefish to show us a way out. Just a thought, can you check signal_cluster.xml to see if any clock line exist in there.
As far as G2 kk rom, it works perfectly
XxZombiePikachu said:
Okay so I am looking for that layout but I got the same issue with stock layout of status bar using textclock and below is screenshot and zip with statusbar.xml/strings.xml
XXZOMBIEPIKACHU WAS HERE
Click to expand...
Click to collapse
Judging from your screenshot, I'd say that your original clock is still showing. Which is interesting because you should have hidden it when you added the attribute 'android:visibility="gone"' to the clock line.
There's a few possible solutions here.
The first thing we could try is removing the '@id/clock' from the TextClock line. This id isn't needed at all. It's needed for the ordinary clock so that the phone can process the clock smali ('LGSystemUI.apk/com/android/systemui/statusbar/policy/Clock.smali') and it knows what part of the statusbar to update.
But TextClock is a fundamental part of Android, there is no smali to reference to. So it's possible that having these two id's could be causing a conflict of some kind which makes the original clock stay visible.
So try changing this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" [COLOR="Red"]android:id="@id/clock"[/COLOR] android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
to this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work, it's possible that something in your rom is overriding that visibility attribute and forcing the clock to be visible. This happens in my rom, I can disable/enable the clock in my Settings app, so my clock line has 'android:visibility="gone"' already.
In which case, we just need to edit the clock line so it's essentially invisible, even if it's technically visible. To do that, we just need to change the width and height.
Like this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" [COLOR="Red"]android:layout_width="0.0dip" android:layout_height="0.0dip"[/COLOR] android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work either, then we need to work out just what you're seeing in your statusbar. The easiest way to do that is simply to have the clock and the TextClock in different colours..
Code:
<com.android.systemui.statusbar.policy.Clock [COLOR="Red"]android:textColor="#ff0000ff"[/COLOR] android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" [COLOR="Red"]android:textColor="#ff00ff00"[/COLOR] android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
This will make the normal clock bright blue and the TextClock bright green. Once you've finished flashing your recompiled apk, you'll be able to see just where that clock on the left is coming from.
Then we will have a better idea of how to get rid of it.
Let me know how it goes!
Ticklefish said:
Judging from your screenshot, I'd say that your original clock is still showing. Which is interesting because you should have hidden it when you added the attribute 'android:visibility="gone"' to the clock line.
There's a few possible solutions here.
The first thing we could try is removing the '@id/clock' from the TextClock line. This id isn't needed at all. It's needed for the ordinary clock so that the phone can process the clock smali ('LGSystemUI.apk/com/android/systemui/statusbar/policy/Clock.smali') and it knows what part of the statusbar to update.
But TextClock is a fundamental part of Android, there is no smali to reference to. So it's possible that having these two id's could be causing a conflict of some kind which makes the original clock stay visible.
So try changing this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" [COLOR="Red"]android:id="@id/clock"[/COLOR] android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
to this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work, it's possible that something in your rom is overriding that visibility attribute and forcing the clock to be visible. This happens in my rom, I can disable/enable the clock in my Settings app, so my clock line has 'android:visibility="gone"' already.
In which case, we just need to edit the clock line so it's essentially invisible, even if it's technically visible. To do that, we just need to change the width and height.
Like this:
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" [COLOR="Red"]android:layout_width="0.0dip" android:layout_height="0.0dip"[/COLOR] android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
If that doesn't work either, then we need to work out just what you're seeing in your statusbar. The easiest way to do that is simply to have the clock and the TextClock in different colours..
Code:
<com.android.systemui.statusbar.policy.Clock [COLOR="Red"]android:textColor="#ff0000ff"[/COLOR] android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:visibility="gone" android:textSize="17.0dip" android:textColor="@color/status_bar_text_color" android:gravity="center_vertical" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_marginEnd="4.0dip"
xmlns:lge="http://schemas.android.com/apk/res/com.android.systemui" />
<TextClock android:textAppearance="@style/TextAppearance.StatusBar.Clock" [COLOR="Red"]android:textColor="#ff00ff00"[/COLOR] android:layout_gravity="center_vertical" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:format12Hour="@string/status_bar_clock_12hr_format" android:format24Hour="@string/status_bar_clock_24hr_format" />
This will make the normal clock bright blue and the TextClock bright green. Once you've finished flashing your recompiled apk, you'll be able to see just where that clock on the left is coming from.
Then we will have a better idea of how to get rid of it.
Let me know how it goes!
Click to expand...
Click to collapse
Alright then as soon as I get home will be sure to get to compiling/testing and report will my findings
XXZOMBIEPIKACHU WAS HERE

Activty height does not match parent on Redmi Note 9 Pro

I am trying to create an activity that will match the parent height. When I am testing the application on Pixel XL the application is fine, but when install on Xiaomi Redmi Note 9 Pro I have one part of the screen that it's not covered. This is the part above the camera, and it might be that my question is not only for this phone but I guess for all the others with the same design.
This is my activity code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/main_screen_background"
tools:context=".activty.WelcomeActivity">
<include layout="@layout/toolbar" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_menu_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
android:layout_marginTop="20dp"
android:layout_marginBottom="60dp" />
</RelativeLayout>
And this is my Toolbar if needed:
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/main_screen_background"
android:theme="@style/AppFullScreenTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<RelativeLayout
android:id="@+id/test_menu_language_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="30dp">
<ImageView
android:id="@+id/about_dropdown_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_ikonki_potrosuvaci_02" />
<TextView
android:id="@+id/language_dropdown_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:text="MK"
android:textColor="@color/white"
android:textSize="20dp" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
What I want to achieve is to have covered also that black part and have the color from the activity, probably an easy thing but I am little rusty with android. I checked the other applications and they are covering that part.
edit:somebody can help?

Categories

Resources