i have created an app which has a TextView which contain some text.
i made it transparent by this code
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/Label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Credit Balance 52$"
android:background = "#00000000"
/>
i want my application to be full screen but at the same time user will be able to see device statusbar behind TextView at top.
Please suggest me some solution of this problem.
Thanks
try using android.R.style.Theme_Translucent theme for your activity
Related
anyone has had this issue?
I am making an android app and my text within textview is a light grey. It is not very visible, but that is the effect I want.
When I look at my emulator it is fine, but when i upload the app to my android device, the text is corrected and now appears as white with a black outline.
I don't want this. I want the light grey color...
here is the actual code for the full layout for those asking:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_splash_screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:layout_gravity="center"
android:background="#ffffff"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="some text here"
android:textColor="#888888" /> </RelativeLayout>
In the comments, #Ma3x asked in the comments:
Since also your battery level and your clock display text are white with a black outline, I assume this is something at your system's level. Do you have some high contrast accessibility turned ON or any custom system-wide UI modifications? Or is it just a default theme like that? –
That gave me the hint I needed. In Settings > accessibility > High Contrast.
I'm working with Android and I want to be able to have the equivalent of two backgrounds for one EditText, essentially. The text will change the color of the ET background as it types, but because it has to be slightly opaque so it's not a solid color, it may show the total View background color too, which will be changing from white as well. To solve this I would like to have a constant white background behind the color-changing translucent background behind the EditText. If any more practical, possible approach is apparent, please share!
put the edit text inside a another layout and set the background colour.
So if your xml was something like this
.
.
.
<EditText
android:layout_width="500dp"
android:layout_height="40dp" />
.
.
.
Now it will become like
.
.
.
<RelativeLayout
android:layout_width="500dp"
android:layout_height="40dp"
android:background="#color/White" >
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
.
.
.
I have a problem that sounds like this:
I have a TabHost and I want to change it's size (height and width) so I used inflate to do this
TextView tabContent = (TextView)getLayoutInflater().inflate(R.layout.tab_content,tab.getTabWidget(),false);
and my xml:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/tab_label"
android:layout_width="80dp"
android:layout_height="fill_parent"
android:gravity="center"
android:textSize="14sp"
android:background="#color/green"
/>
This is working, but the problem is:
How do I inherit the old style of the tab since this is canceling it.
I mean i want this to be on the grey background and if i click it, to take focus and be yellow and so on, like the default tabs?
Thanks
Arkde
When you coose to customize your tabs, the standard tab behaviour is not accessible anymore.
Here is a very good example about customizing Tabs:
http://joshclemm.com/blog/?p=136
In my splash screen I have a TextView that it shows the name of application. Is it possible to add effect(s) (for example shade) to this text?
You can use something like this to put the shadow, it works
<TextView
android:id="#+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/hello"
android:shadowColor="#555555"
android:shadowDx="5.0"
android:shadowDy="5.0"
android:shadowRadius="3.0"
/>
Yes of-course you can make your splash screen more innovative with Shimmer Effect.
If you implement then name of application on splash screen will have glow effect from left to right.
You can see my answer for this effect.
https://stackoverflow.com/a/34327956/2022000
I'm working on an Android widget which essentially places a button on the homescreen. The button uses a selector in order to show a default state and a pressed state. Each state has its own image, as you'll see in the code below.
I already have code to change the hue of an image and return a new StateListDrawable for use in the ImageButton.
My question: How do I actually apply the StateListDrawable to the ImageButton's android:background attribute using the RemoteView?
Here is the XML source for the widget layout:
<LinearLayout
android:id="#+id/LinearLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<ImageButton
android:id="#+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:background="#drawable/buttonselector" />
</LinearLayout>
Instead of using the hardcoded "#drawable/buttonselector" it needs to be the dynamic selector I'm generating.
I have posted an answer link text which I think is similar to your problem. This, however, involves two layouts that are almost similar. The only difference is the part that should change.