[Q] Newbie question about layouts - Android Software Development

Hello,
Im trying to configure my Activity skin like the image
{
"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"
}
How can I do it? If i switch the order my code
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button"/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FA5858"/>
</LinearLayout>
works but in the initial order the imageview fills the whole screen.
Thanks in advance

Time to learn to love, (and hate), RelativeLayout
edit linky:
http://blog.maxaller.name/2010/05/attaching-a-sticky-headerfooter-to-an-android-listview/

You can stick with LinearLayout and change the android:layout_weight parameter of both the ImageView and the Button.
But as alostpacket said, RelativeLayout is the best for this type of layout.

yep.. relative layout will save you
linear layouts are not good for having dead space or for having the size or content of something change while having its position and size stay the same. since you want your button to always be at the bottom of your layout and what ever is inbetween just fillin whats left relative layout is the most useful and powerful way to do that.

Related

looking for help on layout

hi
i try to make this - but with no success
{
"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"
}
can i get any sample for how to do it ?
thanks
GoldSoft said:
hi
i try to make this - but with no success
can i get any sample for how to do it ?
thanks
Click to expand...
Click to collapse
Code:
<RelativeLayout ...>
<TextView
android:layout_alignParentLeft="true"
android:id="@+id/text1"
... />
<TextView
android:id="@+id/text2"
android:layout_toRightOf="@id/text1"
... />
<TextView
android:id="@+id/text3"
android:layout_below="@id/text2"
android:layout_toRightOf="@id/text1"
... />
<TextView
android:id="@+id/text4"
android:layout_below="@id/text3"
android:layout_toRightOf="@id/text1"
... />
<TextView
android:id="@+id/text5"
android:layout_below="@id/text4"
android:layout_toRightOf="@id/text1"
... />
</RelativeLayout>
If you want the screen to be devided into two halfs, then have a look at TableLayout and its android:stretchColums attribute.
If you want the height of each view to be exactly a quarter of the screen height, have a look at LinearLayout and android:weight.

[Tutorials] Add author information at about the phone

First you have to know how to decompile
well,then
Let Tutorials Begin!
1.decompile settings.apk
2.goto res/xml open device_info_settings.xml
3.Find the last line </ PreferenceScreen>,
Add this line in the above
<Preference android:title="@string/123" android:key="123" android:summary="@string/456" style="\?androidreferenceInformationStyle" />
Click to expand...
Click to collapse
Attention to the alignment
{
"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"
}
4.Then the values ​​/ strings.xml find the last line </ resources>
Also note that the alignment
added above the <string name="123"> ROM Developer </ string>
<string name="456"> your name </ string>
(above 456 behind the is the author *information)
Then you can compile it.
well done
A little preview
GOOD I Chinese

Urgent, low headphone mic volume

Hi, I am experiencing the common problem with the headphone microphone... No one can ear me unless I speak with the microphone at 2 cm from my mouth.
I modified the mixer_paths file in etc folder according to the author of this post:
/system/etc/mixer_paths.xml - before modification
=================================================
<path name="headset-mic">
<path name="adc2" />
<ctl name="ADC2 Volume" value="2" />
</path>
/system/etc/mixer_paths.xml - after modification
================================================
<path name="headset-mic">
<path name="adc2" />
<ctl name="ADC2 Volume" value="2" />
<ctl name="DEC8 Volume" value="99" />
</path>
Unfortunately, the microphone volume hasn't improved.
I only have 15 hours to fix the problem, does someone know what should I do to fix it?
I'm on purity 4.4, hellsdoctor-r17, but according to what I read it is not version issue
{
"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"
}
This is the jack, maybe it's an important information, I don't know..
no one?

[Library] Lemniscate Progress View

Hi Xda, I've been working on this library for past couple of weeks. The library is a collection of progress views based on mathematical curves. Please try it, fork it, and contribute to it.
Github project page: https://github.com/vlad1m1r990/Lemniscate
Apache License 2.0.
{
"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"
}
Setup
Add to your module's build.gradle:
Code:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
and to your app build.gradle:
Code:
dependencies {
compile 'com.github.vlad1m1r990:Lemniscate:1.0.2'
}
Usage:
Code:
<com.vlad1m1r.lemniscate.BernoullisProgressView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:duration="1000"
app:hasHole="false"
app:lineColor="@color/colorPrimary"
app:lineLength="0.6"
app:lineLengthChangeable="true"
app:maxLineLength="0.8"
app:minLineLength="0.4"
app:sizeMultiplier="1"
app:strokeWidth="5dp"/>
More about library can be found on GitHub page.

Deep linking not working

I have been trying to make this work for a day now and I have no idea what is the problem.
I am making a Reddit app for a uni project and after Reddit authorizes the app it redirects to another URL which is then supposed to open my app activity so I can collect the data. Only it doesn't.
I have tried multiple http and https URLs, including "http(s)://www.example.com" which is shown in the Android documentation, and it still doesn't want to open the activity.
The redirect URL is https://mpivchev.github.io/Reddit-App/redirect as stated here in the Reddit app settings:
{
"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"
}
What is the problem?
Intent filter:
Code:
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="mpivchev.github.io"
android:scheme="https"
android:pathPrefix="/Reddit-App/redirect" />
</intent-filter>
</activity>
WebView stays on the redirect page instead of returning back to the app:
If you would like to clone the project, this is the GitHub repo: https://github.com/mpivchev/Reddit-App

Categories

Resources