[Q] Custom progress bar - I need a little help - Android Software Development

I'm totally lost right now after trying so many different ways to create a custom progress bar. I'm shooting for something like Catch Notes', it's a perfect example.
Right now, my Action Bar is calling a generic progress bar layout and that works fine. I've attached a picture of what I'm looking for to help even more.
Code:
switch (item.getItemId()) {
case R.id.refresh: //Obviously, this is my refresh Action Bar icon.
item.setActionView(R.layout.progress);
return true;
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar android:id="@+id/progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ProgressBar>
</LinearLayout>

http://developer.android.com/reference/android/widget/ProgressBar.html
one second...
i just noticed you are already setting your own style
Code:
style="?android:attr/progressBarStyleSmall"
can you post your progressBarStyleSmall.xml and other relevant drawables, layer-lists, shapes, and animations xml files?
i have been trying to make one of these for a while as well.

killersnowman said:
http://developer.android.com/reference/android/widget/ProgressBar.html
can you post your progressBarStyleSmall.xml and other relevant drawables, layer-lists, shapes, and animations xml files?
i have been trying to make one of these for a while as well.
Click to expand...
Click to collapse
The style I'm referencing is the default Android ProgressBar style for a small progress bar. You just drag the small progress bar into your layout.

k well you should look into making your own style. i have styles on the brain so i thought it was a custom one.

Related

[Q] N2E (NST) popup text invisible

In many application popups, such as the XKCD Browser's "Hint" function (to show the alt-text), most of the dialog box's text is invisible [see attached photo].
Does anyone know why that is? Is there some kind of "white on white" problem? If so, can I modify such popups system-wide?
Running TouchNooter 2.1.31 over Nook 1.1.0 firmware on Nook Simple Touch (N2E)
I am also seeing this quite often. For example on the intent dialogue the "always open with this application" text is invisible (you only see the checkbox).
The XKCD and the "always open" dialog are two separate, but related issues.
It's the clash of frameworks, themes and styles.
For XKCD, I'd take it apart using apktool and fix it so that the text is black.
For "always open", the problem is that they got fancy inserting the option
and they didn't leave space for it in the dialog.
That needs to get fixed in framework-res.apk.
I have a similar white on white problem with submenus in Goldendict. It could be fixed in the res of the goldendict .apk, but after decompiling/recompling and signing, the resulting .apk will install, but gives errors during usage due to "corruption."
As an alternative approach, what specifically would I need to change in the framework-res.apk in order to fix the problem. Is there some style I could modify to adjust the text color in the framework-res.apk?
This is the responsible code from the goldendict apk that is producing the white-on-white problem.
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:textAppearance="?android:textAppearanceLarge" android:id="@id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5.0px" android:text="@string/from" />
<GridView android:id="@id/fromGrid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="10.0px" android:listSelector="@android:color/transparent" android:columnWidth="50.0sp" android:numColumns="auto_fit" android:layout_weight="1.0" />
<TextView android:textAppearance="?android:textAppearanceLarge" android:id="@id/textView2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5.0px" android:text="@string/to" />
<GridView android:id="@id/toGrid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="10.0px" android:listSelector="@android:color/transparent" android:columnWidth="50.0sp" android:numColumns="auto_fit" android:layout_weight="1.0" />
<TextView android:textAppearance="?android:textAppearanceLarge" android:id="@id/switchToRecentPairs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5.0px" android:text="@string/switch_to_recent_pairs" />
</LinearLayout>
I just logged on here to report this same problem, but I wasn't sure if it was a white-on-white problem or a missing font problem. Would be really great if someone could fix this globally, although I suspect there's nothing you can do globally to fix a hard-coded colour (I may be wrong). App developers should never use a hard-coded colour, its a sloppy design practice.

Image view and Displaying large images without overlaping

Im trying to create a simple app,which loads an image and displays it in an imageview and there is a scroll bar and button below.But after loading large images the image covers up the scroll bar and the button.Tried using different settings with each view's layout but nothing worked.What i want is the image should be displayed in the imageview placed at a fixed location the position of imageview should not be changed neither its size,im quite new to android development im looking for a property like strech in c# which stretches or reduces the size of the images so that it fits in the imageview
Can some one help me,posting the code from main.xml below
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="link"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<ImageView
android:id="@+id/imageView1"
android:layout_width="302dp"
android:layout_height="355dp"
android:src="@drawable/jellyfish" />
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="262dp"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:onClick="clickme"
/>
</LinearLayout>
ImageView has android:scaleType="some_scale_type" property, that does exactly what you require. You can stretch, keep original size or fill available area. There's a problem with you layout, though. Why do you use these absolute values? You know they will look ugly on devices with different DPI/screen sizes, not to mention orientation change?

[Guide] Unlock and Add Permission to Sony Lollipop Theme Engine

Hi, There
IMPORTANT - This topic is for experienced users ONLY
Themes As you all know already Theme Engine in Lollipop did not give so much to do things on 4.4 KK.
Sony has blocked us the opportunity to Lollipop.
But it's already past!!!
Today I discovered a way to add the ability to unlock the Xperia Theme Engine.
Unfortunately it work in all of the app you need to edit them separately.
I will show you an example of Sony Lollipop SystemUI.apk. But the scheme is similar in other Sony apps
​
Before we start a little bit of knowledge:
Each application Sony Xperia contains somc_skin_permissions.xml file.
It is always in the folder res / xml / somc_skin_permissions.xml
This is the file that gives permission for Themes. All values that are out there give you the ability to change them using themes. If it is not missing there possibilities to change it using the Sony themes​
What we need:
-To ApkTool supported Lollipop
-Notepad
-Brain
Lets Start
First Decompile Your Sony app and find file somc_skin_permissions.xml . I will show you an example of the systemUI.
How add permission to changes colors:
Add red lines between (<overlay-resources>) And next group filters ( <filter-group group="status-bar">)
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay-resources>
[COLOR="Red"] <filter-group group="color">
<filter type="type" value="color" />
</filter-group>[/COLOR]
<filter-group group="status-bar">
<filter type="type" value="color,bitmap,nine-patch,vector" />
<filter type="lightness" value="0.425" tolerance="0.425">
<filter type="type" value="color" />
</filter>
.............
To the End Add color values from SystemUI ( Colors.xml ) I add only this values , but you can add all from colors.xml
Code:
.....
<overlay id="@bool/somc_enableKeyButtonGlow" />
[COLOR="red"] <overlay id="@color/system_bar_background_opaque" filters="color" />
<overlay id="@color/system_bar_background_semi_transparent" filters="color" />
<overlay id="@color/system_bar_background_transparent" filters="color" />
<overlay id="@color/system_primary_color" filters="color" />
<overlay id="@color/system_secondary_color" filters="color" />
<overlay id="@color/system_accent_color" filters="color" /> [/COLOR]
</overlay-resources>
Save it
From now , your systemUI have permission to change the colors with Themes
Of course, they must be placed in the file
How add permission to changes navigation buttons:
Add this lines .( Ic_sysbar is png files navigation buttons )
Code:
<overlay id="@drawable/somc_navbar_ime_switcher_btn_immersive_land" filters="sysbar-key-land" />
<overlay id="@drawable/somc_navbar_ime_switcher_btn_no_background_land" filters="sysbar-key-land" />
[COLOR="red"] <overlay id="@drawable/ic_sysbar_back" filters="sysbar-key-port" />
<overlay id="@drawable/ic_sysbar_back_land" filters="sysbar-key-land" />
<overlay id="@drawable/ic_sysbar_home" filters="sysbar-key-port" />
<overlay id="@drawable/ic_sysbar_home_land" filters="sysbar-key-land" />
<overlay id="@drawable/ic_sysbar_recent" filters="sysbar-key-port" />
<overlay id="@drawable/ic_sysbar_recent_land" filters="sysbar-key-land" />
<overlay id="@drawable/ic_sysbar_menu" filters="sysbar-key-port" />
<overlay id="@drawable/ic_sysbar_menu_land" filters="sysbar-key-land" />
<overlay id="@drawable/ic_sysbar_back_ime" filters="sysbar-key-port" />
<overlay id="@drawable/ic_sysbar_back_ime_land" filters="sysbar-key-land" />[/COLOR]
<overlay id="@bool/somc_enableKeyButtonGlow" />
.......
Save and compile your app
From now , your systemUI have permission to change the ic_sysbar buttons with Themes
Soon I will add more examples. But a lot can be downloaded from 4.4 KK apps
You have to keep in mind that the Group filters Varying in different applications.
But you can see how they look applications KK and what is missing
Attached files:
SystemUI of values in unlocked by @serajr
Theme which changes colors and buttons.
Mod and not mod files somc_skin_permissions.xml
Creadits:
RXS MoonBreakers Team
res
res3
res3
like always top work bro.
tanx
alinolaw71 said:
like always top work bro.
tanx
Click to expand...
Click to collapse
Thanks. I'm trying to find solution without mod apps. But don't know whay isn't possible. In kk everything works and some value isn't added.
Ambor said:
Thanks. I'm trying to find solution without mod apps. But don't know whay isn't possible. In kk everything works and some value isn't added.
Click to expand...
Click to collapse
Giving permissions isn't enough for runtime-skinning, it's only the starting point. The app must also handle the theme changes while the app is running. That can be done only in smali. I know because I made my expanded status bar (notifications header and quick settings background) color change the moment you change a theme (instead of having to reboot the device to apply the changes).
And you can't do that without modding the apps, each app handles it on its own behalf.
IaguCool said:
Giving permissions isn't enough for runtime-skinning, it's only the starting point. The app must also handle the theme changes while the app is running. That can be done only in smali. I know because I made my expanded status bar (notifications header and quick settings background) color change the moment you change a theme (instead of having to reboot the device to apply the changes).
And you can't do that without modding the apps, each app handles it on its own behalf.
Click to expand...
Click to collapse
I know that, but for now this is the only way that I know that the theme work.
KK theme work, even as there was no value in skin_permission
At Lollipop if I add value is not in skin_permission the theme file zip does not work.
try to use my theme for stock systemUI. Your buttons do not change.
I think that this is not a big problem for Members that you have to restart the phone to do.
On KK need to restart phone and it was no one complained
As you have any ideas
would love to hear
Regards
I know where are smili files in KK. But where are in Lollipop
Ambor said:
I know where are smili files in KK. But where are in Lollipop
Click to expand...
Click to collapse
Hah, the smali files are in the same place XD
Ambor said:
I know that, but for now this is the only way that I know that the theme work.
KK theme work, even as there was no value in skin_permission
At Lollipop if I add value is not in skin_permission the theme file zip does not work.
try to use my theme for stock systemUI. Your buttons do not change.
I think that this is not a big problem for Members that you have to restart the phone to do.
On KK need to restart phone and it was no one complained
As you have any ideas
would love to hear
Regards
Click to expand...
Click to collapse
Most likely it's because that MyExampleTheme isn't implemented correctly. Try the attached theme on a stock SystemUI and you'll see that the navigation buttons change immediately, no restart needed.
IaguCool said:
Hah, the smali files are in the same place XD
Most likely it's because that MyExampleTheme isn't implemented correctly. Try the attached theme on a stock SystemUI and you'll see that the navigation buttons change immediately, no restart needed.
Click to expand...
Click to collapse
Your theme have bug brother. I know what part of theme request reboot. Button will not changed in album apk
Ambor said:
Your theme have bug brother. I know what part of theme request reboot. Button will not changed in album apk
Click to expand...
Click to collapse
1st - It's not my theme.
2nd - I don't know what you mean. What does it have to do with Album apk?
IaguCool said:
1st - It's not my theme.
2nd - I don't know what you mean. What does it have to do with Album apk?
Click to expand...
Click to collapse
Appy theme button will change
Go to Sony album apk and see ( buttons will back to stock )
IaguCool said:
Hah, the smali files are in the same place XD
Most likely it's because that MyExampleTheme isn't implemented correctly. Try the attached theme on a stock SystemUI and you'll see that the navigation buttons change immediately, no restart needed.
Click to expand...
Click to collapse
Not all applications are in the same place ...
And as you know where they are then why do not you share in ???
Or you do not guide how to do it. We are happy to see it ...
I came up with a way for action Themes.
But I see that you're so smart with know better ... So we are waiting for your guide ...
Regards
Ambor said:
Not all applications are in the same place ...
And as you know where they are then why do not you share in ???
Or you do not guide how to do it. We are happy to see it ...
I came up with a way for action Themes.
But I see that you're so smart with know better ... So we are waiting for your guide ...
Regards
Click to expand...
Click to collapse
I never said you weren't right, I said that it's just incomplete, so pick your tone very carefully. Sorry, not dealing well with narcissistic pricks.
And just for your information - maybe adding the navigation buttons is good (for old themes compatibility) but for colors?
Colors should not be set in systemui.zip, because SystemUI.apk use system-wide colors, which can be found in framework-res.apk and the basic are:
Code:
<color name="somc_color_dark_primary_dark">#ff158597</color>
<color name="somc_color_primary_dark">#ff009faf</color>
<color name="somc_color_accent_dark">#ffd15b40</color>
<color name="somc_color_dark_primary_light">#ff2699a5</color>
<color name="somc_color_primary_light">#ff2ab9d2</color>
<color name="somc_color_accent_light">#ffed6642</color>
<color name="somc_color_background_light">#fffafafa</color>
And framework-res.apk already has the required permissions built-in:
Code:
<overlay id="@color/somc_color_dark_primary_dark" filters="color" />
<overlay id="@color/somc_color_primary_dark" filters="color" />
<overlay id="@color/somc_color_accent_dark" filters="color" />
<overlay id="@color/somc_color_dark_primary_light" filters="color" />
<overlay id="@color/somc_color_primary_light" filters="color" />
<overlay id="@color/somc_color_accent_light" filters="color" />
The themes must override these in android.zip, not systemui.zip, unless you want to do everything twice and add pointless permissions and exactly the same color values in another zip file of the theme.
Now if you want to tweak SystemUI to use the system-wide colors, you don't need extra permissions, you need to set system-wide references:
First you need to set "system_primary_color" to use "@android:color/somc_color_dark_primary_dark" (This is the slightly darker one, by default).
Then you need to set "system_secondary_color" to use "@android:color/somc_color_primary_dark" (This is the slightly brighter one, by default).
Then you need to set "system_accent_color" to use "@android:color/somc_color_accent_dark".
Then you need to set the color "system_bar_background_opaque" to use "@color/system_primary_color".
You can leave the "system_bar_background_semi_transparent" permission in, if you really think that changing the semi-transparent color is a good idea.
The color "system_bar_background_transparent" should NEVER be skinnable, because, well - it's transparent!
There is an extra step needed to make sure the navigation bar is black in "lights-out" mode (like for example - in desk clock).
Now I'm looking to unify the color changes made to the status bar and the navigation bar, since they are set separately by apps, example - Gmail app's style sets only the status bar to red:
Code:
<item name="android:statusBarColor">@color/mail_activity_status_bar_color</item>
While to change the navigation bar color the style needs to set "android:navigationBarColor" also.
To do that, it's only by editing smali in android.policy.jar.
Here's the current result, in the attachment. Some apps show a transparent navigation bar background instead (like Gmail and Google Keep) which I'm trying to solve, but others colorize the navigation bar correctly.
That being said, each app can set the android:navigationBarColor item in their styles.xml, they just chose not to.
IaguCool said:
I never said you weren't right, I said that it's just incomplete, so pick your tone very carefully. Sorry, not dealing well with narcissistic pricks.
And just for your information - maybe adding the navigation buttons is good (for old themes compatibility) but for colors?
Colors should not be set in systemui.zip, because SystemUI.apk use system-wide colors, which can be found in framework-res.apk and the basic are:
Code:
<color name="somc_color_dark_primary_dark">#ff158597</color>
<color name="somc_color_primary_dark">#ff009faf</color>
<color name="somc_color_accent_dark">#ffd15b40</color>
<color name="somc_color_dark_primary_light">#ff2699a5</color>
<color name="somc_color_primary_light">#ff2ab9d2</color>
<color name="somc_color_accent_light">#ffed6642</color>
<color name="somc_color_background_light">#fffafafa</color>
And framework-res.apk already has the required permissions built-in:
Code:
<overlay id="@color/somc_color_dark_primary_dark" filters="color" />
<overlay id="@color/somc_color_primary_dark" filters="color" />
<overlay id="@color/somc_color_accent_dark" filters="color" />
<overlay id="@color/somc_color_dark_primary_light" filters="color" />
<overlay id="@color/somc_color_primary_light" filters="color" />
<overlay id="@color/somc_color_accent_light" filters="color" />
The themes must override these in android.zip, not systemui.zip, unless you want to do everything twice and add pointless permissions and exactly the same color values in another zip file of the theme.
Now if you want to tweak SystemUI to use the system-wide colors, you don't need extra permissions, you need to set system-wide references:
First you need to set "system_primary_color" to use "@android:color/somc_color_dark_primary_dark" (This is the slightly darker one, by default).
Then you need to set "system_secondary_color" to use "@android:color/somc_color_primary_dark" (This is the slightly brighter one, by default).
Then you need to set "system_accent_color" to use "@android:color/somc_color_accent_dark".
Then you need to set the color "system_bar_background_opaque" to use "@color/system_primary_color".
You can leave the "system_bar_background_semi_transparent" permission in, if you really think that changing the semi-transparent color is a good idea.
The color "system_bar_background_transparent" should NEVER be skinnable, because, well - it's transparent!
There is an extra step needed to make sure the navigation bar is black in "lights-out" mode (like for example - in desk clock).
Now I'm looking to unify the color changes made to the status bar and the navigation bar, since they are set separately by apps, example - Gmail app's style sets only the status bar to red:
Code:
<item name="android:statusBarColor">@color/mail_activity_status_bar_color</item>
While to change the navigation bar color the style needs to set "android:navigationBarColor" also.
To do that, it's only by editing smali in android.policy.jar.
Click to expand...
Click to collapse
Bro no need to edit smili
you only add this
Code:
<item name="colorPrimary">@color/somc_color_primary_dark</item>
<item name="colorPrimaryDark">@color/somc_color_dark_primary_dark</item>
<item name="statusBarColor">?colorPrimaryDark</item>
<item name="navigationBarColor">?colorPrimary</item>
[COLOR="Red"] <item name="somcSkinnableTranslucentBars">false</item>[/COLOR]
This code block SONY SYSTEMUI dimming
<item name="somcSkinnableTranslucentBars">false</item>
and navi bar will be dimming colorPrimary
and statusbar to colorPrimaryDark
These things I have done 1 month ago ...
Look:
http://forum.xda-developers.com/cro...-modded-stock-tele-service-semcphone-t3059884
http://forum.xda-developers.com/cro...d-theme-accent-widgets-sony-lollipop-t3069971
Ambor said:
Bro no need to edit smili
you only add this
Code:
<item name="colorPrimary">@color/somc_color_primary_dark</item>
<item name="colorPrimaryDark">@color/somc_color_dark_primary_dark</item>
<item name="statusBarColor">?colorPrimaryDark</item>
<item name="navigationBarColor">?colorPrimary</item>
[COLOR="Red"] <item name="somcSkinnableTranslucentBars">false</item>[/COLOR]
This code block SONY SYSTEMUI dimming
<item name="somcSkinnableTranslucentBars">false</item>
and navi bar will be dimming colorPrimary
and statusbar to colorPrimaryDark
These things I have done 1 month ago ...
Look:
http://forum.xda-developers.com/cro...-modded-stock-tele-service-semcphone-t3059884
http://forum.xda-developers.com/cro...d-theme-accent-widgets-sony-lollipop-t3069971
Click to expand...
Click to collapse
Did you even look at the screenshots? What you mention is navigation bar colorizing in SONY apps. What I'm talking about is colorizing in ALL others apps, according to the app's specific theme, not your Xperia theme accent. The screenshots show you how the nav bar's color is changed to red in YouTube, while changes to dark-green in Whatsapp and light-green in Pushbullet. Those are NOT theme accent colors, those colors are set by the application.
IaguCool said:
Did you even look at the screenshots? What you mention is navigation bar colorizing in SONY apps. What I'm talking about is colorizing in ALL others apps, according to the app's specific theme, not your Xperia theme accent. The screenshots show you how the nav bar's color is changed to red in YouTube, while changes to dark-green in Whatsapp and light-green in Pushbullet. Those are NOT theme accent colors, those colors are set by the application.
Click to expand...
Click to collapse
this block dimming
<item name="somcSkinnableTranslucentBars">false</item>
Stock valiue is
<item name="somcSkinnableTranslucentBars">true</item>
I'm not talking to you. You do not understand me. I know the method I have described.
and the effect will be similar
Code:
<style name="Theme.Material" parent="@style/Theme">
<style name="Theme.Material.Light" parent="@style/Theme.Light">
<item name="navigationBarColor">?colorPrimary</item>
besides colors are just an example.
This way you can give permission to a lot of other things as changing PNG files or other icons.
I do try to change icons with just a Theme...happy to see him
Instead of spamming my topic, do something useful write a guide.
Ambor said:
Instead of spamming my topic, do something useful write a guide.
Click to expand...
Click to collapse
Do you even know what "spamming" means? You've got some real issues.

take a screenshot of a nested RelativeLayout

I hope that I posted this thread correctly...
It's my first android app and I am using android studio. I want to get a screenshot of a specifi area.
My xml is in this format:
<LinearLayout>
<RelativeLayout>
<RelativeLayout>
<TextView />
<TextView/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
The two textviews are overlapping. The one holds an image (with transparency) and the other one, a background color and a text (this is why I have them on a single RelativeLayout and overlapping). I want to get a screenshot of this RelativeLayout. Any help please? Nothing of what I have used worked.

[NST/G] Editing framework-res.apk xml files

I'd like to make a few small changes in the framework-res.apk. I thought this might be "easy", but so far it's not.
I decompiled the apk file using apktool and located the two files I wanted to alter in res/layout. I made the changes, then saved the two edited files.
Next I opened the original framework-res.apk archive with WinRAR and then dragged the edited xml files into the proper location ("store", not "normal" or "compress") and then closed the archive.
Finally, I used CWM to copy the new framework-res.apk back to the NST and rebooted.
Boot loop.
Is it not possible to deal with slightly edited xml files in this way?
nmyshkin said:
I'd like to make a few small changes in the framework-res.apk. I thought this might be "easy", but so far it's not.
I decompiled the apk file using apktool and located the two files I wanted to alter in res/layout. I made the changes, then saved the two edited files.
Next I opened the original framework-res.apk archive with WinRAR and then dragged the edited xml files into the proper location ("store", not "normal" or "compress") and then closed the archive.
Finally, I used CWM to copy the new framework-res.apk back to the NST and rebooted.
Boot loop.
It is not possible to deal with slightly edited xml files in this way?
Click to expand...
Click to collapse
I found a working method: https://forum.xda-developers.com/t/...rk-res-apk-with-apktool.1545361/post-23589640
But...I want to move the quicknav bar to the top of the screen. The changes I made in the xml files do that, but the status bar covers the top part of the quicknav bar. Ideally I'd like the quicknav bar to cover the status bar (maybe not allowed?), or at least position right beneath it.
The relevant xml code which seems to control the screen position of the quicknav bar looks like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/quickNavMainView" android:background="@drawable/checker" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<HorizontalScrollView android:layout_gravity="bottom|center" android:id="@id/quickNavHSView" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_gravity="bottom|center" android:layout_width="wrap_content" android:layout_height="wrap_content">
<ImageView android:id="@id/home" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_home_normal" />
<ImageView android:id="@id/library" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_library_normal" />
<ImageView android:id="@id/shop" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_shop_normal" />
<ImageView android:id="@id/search" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_search_normal" />
<ImageView android:id="@id/settings" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_settings_normal" />
</LinearLayout>
</HorizontalScrollView>
</FrameLayout>
I've changed "bottom" in lines 4 and 5 to "top". That gets the job done, but with the problem mentioned: the status bar covers the top portion of the quicknav bar.
Help?
Changing framework or services or whatever you don't need to go to recovery.
They are just part of Android and have no influence on the Linux.
Code:
# stop
<do stuff>
# start
How about a screen shot?
I don't even think that I've ever even seen the stock QuickNav.
I'm not sure if this frame is the full screen or what.
How about adding android:layout_marginTop="24dp"?
(That dimension was picked out of the air. YMMV)
Renate said:
How about a screen shot?
I don't even think that I've ever even seen the stock QuickNav.
I'm not sure if this frame is the full screen or what.
How about adding android:layout_marginTop="24dp"?
(That dimension was picked out of the air. YMMV)
Click to expand...
Click to collapse
Thanks for the response. I'll try the marginTop idea. I've been looking all over for something like that but just hadn't generated the proper search string I guess.
Getting screenshots was a lot harder than I anticipated. The quicknav bar seems to disable the side hardware buttons when it is displayed but I finally figured out a way to get reasonable shots. You can clearly see the issue with the status bar when the quicknav buttons are moved to the top.
nmyshkin said:
I finally figured out a way to get reasonable shots.
Click to expand...
Click to collapse
What's the matter? You don't like my AdbGrab.exe (in sig)?
Renate said:
I'm not sure if this frame is the full screen or what.
How about adding android:layout_marginTop="24dp"?
(That dimension was picked out of the air. YMMV)
Click to expand...
Click to collapse
You were close (and right, of course)!
The bar becomes a little scrunched for some reason (less white space above and below icons/text) but it just abuts the status bar with android:layout marginTop="18dp". I don't care much about the loss of the white space, so it's on with the rest of my project.
Thanks again for the help.
Hmm, something's screwy.
Maybe try this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/quickNavMainView" android:background="@drawable/checker" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="18dp">
<ImageView android:id="@id/home" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_home_normal" />
<ImageView android:id="@id/library" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_library_normal" />
<ImageView android:id="@id/shop" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_shop_normal" />
<ImageView android:id="@id/search" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_search_normal" />
<ImageView android:id="@id/settings" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_settings_normal" />
</LinearLayout>
</FrameLayout>
Renate said:
Hmm, something's screwy.
Maybe try this:
Code:
<?xml version="1.0" encoding="utf-8"?>
...etc.
Click to expand...
Click to collapse
It seems to make no discernible difference. I notice that the line:
Code:
<HorizontalScrollView android:layout_gravity="bottom|center" android:id="@id/quickNavHSView" android:layout_width="fill_parent" android:layout_height="wrap_content">
is missing from your version. That, too, seems to make no difference.
There is another xml file which seems to have something to do with the "appicons" (which are just png images stored in the apk, text included):
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/appIcon" android:layout_width="wrap_content" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_gravity="top|left|center" android:id="@id/badgeImage" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
Not seeing anything there that jumps out at me. If the android:layout_marginTop="18dp" is changed to something like "100dp" the bar more or less collapses into a fat line, as well as moving further down the display window, so there is some interaction between the "simple" shifting of the vertical display of the bar and the vertical size of the bar itself.
Like I say, it's not a big deal for me. As long as content is not cut off, a slight flattening of quicknav bar is fine.
All the tiles are 120 x 112 so that the horizontal scroll is overblown. (5 x 120 = 600).
I was trying to get rid of that.
Use my only Linear Layout and change layout_height="112dp"
For testing purposes you can also add android:background="#cccccc".
That way if the LL expands but the buttons don't you can see the shading.
Renate said:
All the tiles are 120 x 112 so that the horizontal scroll is overblown. (5 x 120 = 600).
I was trying to get rid of that.
Use my only Linear Layout and change layout_height="112dp"
For testing purposes you can also add android:background="#cccccc".
That way if the LL expands but the buttons don't you can see the shading.
Click to expand...
Click to collapse
Does the android:background="#cccccc" go in the LinearLayout section or in the overall FrameLayout? Right now it's kinda moot because I can't seem to produce an apk file that does not cause a bootloop. I have a previous trial version with android:layout_ marginTop="20dp" which does NOT produce a bootloop. The file size is about 2874 Kb. Every new version I try to build with Apktool today is coming out around 3366 Kb and they all cause a bootloop. I have no idea what is going on with Apktool, but I'll keep plugging away, with breaks for mental health!
nmyshkin said:
Does the android:background="#cccccc" go in the LinearLayout section...
Click to expand...
Click to collapse
In the LL.
When you're floundering in layouts, it's helpful to set some color background for each containing element.
Obviously, on a B&W device you'll not see that, but a screen grab will show it.
(You can just stick to background colors that are differentiable in B&W,)
The FrameLayout is the whole screen which dims the normal screen.
The LinearLayout should be 600 x 120 automatically.
You can even do a reality check by saying (in LL) android:layout_height="500dp".
Renate said:
When you're floundering in layout...
Click to expand...
Click to collapse
I think "floundering" is the operative word here!
Try as I might, I have been unable to produce a framework-res.apk that did not cause a boot loop IF I left out the
Code:
<HorizontalScrollView android:layout_gravity="bottom|center" android:id="@id/quickNavHSView" android:layout_width="fill_parent" android:layout_height="wrap_content">
This is what I have right now:
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/quickNavMainView" android:background="@drawable/checker" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<HorizontalScrollView android:layout_gravity="top|center" android:id="@id/quickNavHSView" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:layout_gravity="top|center" android:layout_width="wrap_content" android:layout_height="112dp" android:layout_marginTop="18dp" android:background="#cccccc">
<ImageView android:id="@id/home" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_home_normal" />
<ImageView android:id="@id/library" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_library_normal" />
<ImageView android:id="@id/shop" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_shop_normal" />
<ImageView android:id="@id/search" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_search_normal" />
<ImageView android:id="@id/settings" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/c_quicknav_settings_normal" />
</LinearLayout>
</HorizontalScrollView>
</FrameLayout>
I was surprised to find that changing android:layout_gravity="top|center" in the LinearLayout section did NOT move the bar to the top. It was only when I made the change in the HorizontalScrollView that the bar went to the top of the screen (or almost).
I don't see any shading and perhaps the boxes are now even a bit smaller than before (see screenshot below). Again, I could live with this so it's not a deal-breaker for my intended project. It is interesting (and maybe just a little hair-raising) how these things interact in ways that I would not expect.
When you have a "boot loop" (which is just really Android flailing while the Linux is fine) you should check the logcat, it will tell you where the problem is.
I don't know how I missed where that HorizontalScroll was being used.
Yeah, I do. I was accidentally looking for quickNavHsView and not quickNavHSView.
In services.jar, com/android/server/status/StatusBarService uses that.
It must be a HorizontalScroll. You need that.
The quick nav itself is com/android/server/status/BNGossamerQuickNavbar
The default for layouts is top anyway.
Make the LinearLayout big, android:layout_height="300dp".
You won't see any background of the LL until it's bigger than its contents.
Renate said:
Make the LinearLayout big, android:layout_height="300dp".
You won't see any background of the LL until it's bigger than its contents.
Click to expand...
Click to collapse
OK. I did that but I'm not sure exactly what it tells me except that the size of the layout is greater than the size of the actual navbar images? I see this sort of thing when I am designing a scene in Tasker and the background field is larger than the image itself. There I would know what to do. Here....
Also, how does this relate to the squished (cut off?) images in the navbar?
Edit: I take some of this back now that I have looked more closely at the screenshot. The navbar is not so squished, although still not full size. This would suggest that if I make android:layout_height even larger the navbar will return to normal size. And maybe it does not matter since the background is transparent if I don't specify a color?
So, Bob's your uncle.
For the LinearLayout
android:layout_height="152dp" android:layout_marginTop="40dp"
You don't need to add a background.
How are you getting those screenshots and why are they JPEGs?
You can use
Code:
# screenshot /sdcard/snap.png
I forget if AdbGrab works for that.
There is that whole screenshot/screencap/framebuffer thing.
(Also format 1 & formt 2)
Renate said:
So, Bob's your uncle.
For the LinearLayout
android:layout_height="152dp" android:layout_marginTop="40dp"
You don't need to add a background.
How are you getting those screenshots and why are they JPEGs?
You can use
Code:
# screenshot /sdcard/snap.png
I forget if AdbGrab works for that.
There is that whole screenshot/screencap/framebuffer thing.
(Also format 1 & formt 2)
Click to expand...
Click to collapse
Well, that's just nifty! Thanks for looking at this and helping out.
I'm getting the screenshots using my swiss army knife app QuickTiles which includes a screenshot option. This uses the Screenshot Easy app as a plugin. I selected jpeg as the format, could have been png. You may recall that the native screenshot capabilities of the NST leave something to be desired. Screenshots come out with a green cast (or is is blue?) because of some weird color coding which I can't remember now.
Anyway, I normally have Quick Tiles assigned to the "clock" region of the status bar, but I want the quicknav bar there, so I temporarily assigned Quick Tiles to the "n" button. As much as I love Quick Tiles and spent a lot of time figuring it all out, I will be the first to admit that it is sometimes maddeningly slow to open. Other times it is nearly immediate, just like any other app on the NST. The quicknav bar (which I don't use at all), opens instantaneously. Over time and use I've worked my tile selection down to 5 (6 for my NSTG), so I've been thinking about trying to adapt the quicknav bar to replace Quick Tiles. It doesn't have the gee-whiz stuff like the battery percentage, date, and so on, but the response time is what I'm after at this point in my life.

Categories

Resources