Tag Archives: Android primary

Modifying the default style of scrollbar in Android

Well, I met the requirement again, and needed to modify the style of ScrollBar, so I looked up a lot of documents, I think the summary of this great cow is good, by the way, I took a look at his home page, wow, great ~!! Attach great god article links: http://likfe.com/archives/

knowledge points in the ListView/ScrollView/RecyclerView add attributes:
android: vertical scrollbars = “”
android: scrollbarTrackVertical =” @ drawable/xxx_vertical_track “
android: scrollbarThumbVertical =” @ drawable/xxx_vertical_thumb “
B: Horizontal scroll bar
android: horizontal scrollbars = “”
android: scrollbarTrackHorizontal =” @ drawable/xxx_horizontal_track “
android: scrollbarThumbHorizontal =” @ drawable/xxx_horizontal_thum “
other common attributes
defines the style and position of the scrollbar
android:scrollbarStyle= “outsideInset”
2. Define the size of the scroll bar, refers to the width, when the vertical level refers to the height of the
android: dp scrollbarSilbarSize = “4”

0

2

4

5

6

8

attributes effects
1 scrollbarThumbVertical[Horizontal] 3 short bars
7 scrollbarTrackVertical[Horizontal] 9 long bars, The background
Note that
where scrollbaTrackxxx, scrollbarThumbxxx can use:
◦ custom Shape

◦. ◦ can be registered for use.9. PNG
@color/ XXX to use color values
You cannot use the # XXXXXX color value directly
Android :scrollbarStyle can define the style and position of the scrollbar with four optional values including insideOverlay, insideInset, outsideOverlay and outsideInset.
Where inside and outside respectively mean whether the overlay is inside the padding of the view, overlay and inset mean whether the overlay is on the view or inserted behind the view, so the four values respectively represent:

0

3

4

6

attribute value effect of the

insideOverlay

default values, Inside the padding and overlaid on the view
means inside the padding and inserted behind the view
outsideInset 1 means outside the padding and inserted behind the view
5 outsideOverlay 7 inside the padding Outside and overlying the view

Demo
note:
scrollbarTrackVertical can be set to transparent or not directly set android: scrollbarTrackVertical = “@ color/transparent”
again: scrollbarThumbVertical, scrollbarTrackVertical can not directly set to color values, but you can use @ color
Layout:

android:scrollbarStyle="outsideOverlay"
android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"
android:scrollbarSize="3dp"
android:scrollbars="vertical"

Demo 2
layout:

android:scrollbarStyle="outsideOverlay"
android:scrollbarThumbVertical="@color/red_square"
android:scrollbarSize="3dp"
android:scrollbars="vertical”

default:

Demo2 effect:

Demo1 effect:

Nexus 5x unlock bootloader + root

The self-use test machine suddenly failed root, the network looked for a lot of tutorials, finally found a reliable tutorial, hereby record, some mobile phones may also be applicable
Kingroot has always been used for root, but this time suddenly prompted me “Need root please unlock first”
Let’s start by unlocking:
note:

Unlocking the bootloader for the first time will erase all your data.

Take a look at what it looks like ununlocked:

The unlocking steps are as follows:
1. Open the phone Settings – about the phone – click the version number 7 times to open the “Developer Options”
2. Back to the previous step, developer options – turn on USB debugging and turn on “Enable OEM Unlock”
3. Turn off your phone
4. Press and hold the power key & AMP; Volume down key, enter fastboot(Bootloader interface)
5. Connect the phone with usB-A data cable
6. Open DOS window and enter: Enter fastboot OEM unlock
If DOS prompts “not an internal or external command”, then you need to configure the environment variable
, find the path to your SDK, and add the path of platform-tools to the path
: D:\Android\ SDK \platform-tools

Because we are using the fastboot.exe execution file



Then use the volume key to select “Yes” and press the “power” button to confirm. After success, it will be displayed as follows :(the red sentence at the bottom)


At this point, it has been unlocked. After unlocking, the opening machine has this prompt, which belongs to normal:

After the completion of unlocking the root operation will be performed, the use of kingroot, 360Root and other software was unsuccessful.
root download
Unlock the original
http://tieba.baidu.com/p/4232343051