How could I disable all the over scroll effect in my app? - android

The blue shadow over scroll effect looks really ugly in our app.
Is there a way to disable all the over scroll effect? You know there are lots of ScrollViews and Lists in it... That would be a shame if I have to disable it in every widget that can
scroll...
thx~

You can do it simply
In layout.XML
Set
android:overScrollMode="never"
In scrollview

You can define a ScrollViewStyle and ListViewStyle in your Theme:
<style name="Theme.MyTheme" parent="android:Theme.Holo">
<item name="android:listViewStyle">#style/Widget.MyTheme.ListView</item>
<item name="android:scrollViewStyle">#style/Widget.MyTheme.ScrollView</item>
</style>
<style name="Widget.MyTheme.ListView" parent="android:Widget.ListView">
<item name="android:overScrollMode">never</item>
</style>
<style name="Widget.MyTheme.ScrollView" parent="android:Widget.ScrollView">
<item name="android:overScrollMode">never</item>
</style>
Then you have to define your Theme in you AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.citux.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="16" android:minSdkVersion="8"/>
<application
android:hardwareAccelerated="true"
android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#style/Theme.MyTheme">
That's it, no more overscroll ;)

I have face same problem
try this code
listView.setOverScrollMode(View.OVER_SCROLL_NEVER);

You can disable all the over scroll effects by opening "res/values/styles.xml" file and adding the item line like bellow:
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:overScrollMode">never</item>
</style>

Have you already used setOverScrollMode, with OVER_SCROLL_NEVER?

Related

Prevent app from overriding the Android notification bar

I have the following simple layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
</android.support.constraint.ConstraintLayout>
How can I keep the notification permanently displayed in my app? My SDK-Version is 27. I already tried a lot of the solutions available and none seemed to have worked.
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
My styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:statusBarColor">#color/colorPrimaryDark</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
Looks like SceneForm's BaseARFragment makes the host Activity use immersive mode via an OnWindowFocusChangeListener. I think you should be able to add your own OnWindowFocusChangeListener and it would be called after the other one, so you could override this behavior.
arFragment.arSceneView?.viewTreeObserver.addOnWindowFocusChangeListener { hasFocus ->
if (hasFocus) {
window.decorView
.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
}
}
Read up on the system UI flags to decide which ones you actually want.

How to make android layout background transparent?

How to make RecyclerView item background transparent I need to show background image?
I tried 3 solutions given in Stack Overflow and not worked for me
1 : android:background="?android:attr/selectableItemBackground"<br>
2 : android:background="#android:color/transparent"<br>
3 : alpfha 0.4
udated i also tried
4: android:background="#null" (Answer from this post) and not working
full xml code
Try to give this on your item CardView
app:cardBackgroundColor="#android:color/transparent"
Try this:
1) In your manifest make that activity theme to Transparent-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidhub4you.transparent.background"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.androidhub4you.transparent.background.MainActivity"
android:theme="#android:style/Theme.transparent"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
2) Now your page will be 100% transparent, so if you need some background color then set opacity like-
<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="#80000000"
tools:context=".MainActivity" >
it helps you.
So for the layout you are inflating for the item you can use
android:background="#null"
You can also use developer options on your device to see layout bounds or check the view hierarchy to see which item is giving you problems
First add this style in styles.xml
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="colorPrimaryDark">#android:color/transparent</item>
</style>
then add this line in AndroidManifest.xml below the corresponding activity
android:theme="#style/Theme.Transparent"/>
hope it helps.
set all layout backgrouncolor= '#00000000' also to your Recycleview background color to achieve this view
set transparent color in your view
#80000000

AppCompat theme

I need your help for an issue occured about AppCompat theme. My MainActivity is derived from AppCompatActivity and the theme is declared in the Manifest but when I compile I get this error:
Java.Lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
This is the file containing the theme:
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#3F51B5</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">#303F9F</item>
<!-- theme UI controls like checkboxes, text fields and switchcompat button-->
<item name="colorAccent">#00FFFF</item>
</style>
And this is manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test_vp.test_vp" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="16" />
<uses-feature android:name="android.hardware.wifi" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="#string/ApplicationName" android:theme="#style/MyTheme">
</application>
</manifest>
Do You know how can I solve it?
Thank You in advance
Change the first line of code you show:
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
to
<style name="MyTheme" parent="#android:style/Theme.AppCompat.Light.NoActionBar">
Also, inside this style definition is where you put children definition to only there you define characteristics like color etc. It's a case of nested definition. Let me try to clear things:
First you define your main style which refers to your secondary style:
<style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:actionBarStyle">#style/MyTheme.ActionBarStyle</item>
</style>
Second, in this same xml you're working, below you define this child style, it is inside this where you choose colors etc. Pay attention with the name of this child theme - must be the same you referenced on parent:
<style name="MyTheme.ActionBarStyle" parent="#android:style/Widget.Holo.ActionBar">
<item name="colorPrimary">#3F51B5</item>
</style>
In some cases you will have to go deep inside this nesting, defining things by detailed steps. To resume: you can't change things directly, have to specify every detailed portion where you want to customize.
try:
<style name="MyTheme" parent="#style/Theme.AppCompat.Light.NoActionBar"></style>
It's in support lib, so ommit the "android:" part.

Android - Actionbar

i want to change the color of the actionBar, i was reading the appcelerator docs and reproduce the code with no results.
What am i doing wrong ?
tiapp.xml
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="#style/Theme.CustomActionBar"/>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" android:maxSdkVersion="23"/>
</manifest>
<manifest android:versionCode="3" android:versionName="1.0.1"/>
</android>
custom theme
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.CustomActionBar" parent="#style/Theme.AppCompat">
<item name="colorPrimary">#1565C0</item>
<item name="colorPrimaryDark">#0D47A1</item>
<item name="colorAccent">#FF80AB</item>
<item name="colorControlNormal">#757575</item>
<item name="colorControlActivated">#FF6E40</item>
<item name="colorControlHighlight">#FF4081</item>
<item name="colorSwitchThumbNormal">#BDBDBD</item>
<item name="android:colorButtonNormal">#BDBDBD</item>
<item name="android:colorEdgeEffect">#FF4081</item>
</style>
</resources>
Screenshot
Thanks in advance..
Titanium Appcelerator 4.5
SDK: 5.2.0 GA
Genymotion
Remove this line: <manifest android:versionCode="3" android:versionName="1.0.1"/> and put the android:versionCode and android:versionName into the first manifest tag.

Setting background image to an application which already has a theme

Hi i want to set background image to my application which already has a theme.
<application android:theme="#android:style/Theme.NoTitleBar" />
Now i have changed the code to this
<style name="BackgroundImage" parent="#android:style/Theme.NoTitleBar">
<item name="android:background">#drawable/background</item>
</style>
the manifest file looks like this
<application android:theme="#style/BackgroundImage" />
Now the background image is set but my previous theme i.e. Theme.NoTitleBar is not working.
Ideal behavior expected is both background image and Theme.NoTitleBar should be working. What should i do?
I have changed the style as follows by doing this i am overriding the Theme.NoTitlteBar
<style name="Background" parent="#android:style/Theme.NoTitleBar">
<item name="android:windowBackground">#android:color/black</item>
<item name="android:windowNoTitle">true</item>
</style>
Now manifest file looks like this.
<application android:theme="#style/Background"/>
you need to do it in the xml file, and not your manifest.
you just have to do somerhing like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/yourimage" > //your drawable image here
hope i helped you

Categories

Resources