GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kongnanlive/PreferenceFragment: Unofficial Support PreferenceFragment compatibility layer for Android 2.1 and up.

BranchesTags
Open more actions menu

Latest commit

 

History

17 Commits
17 Commits

Folders and files

NameName
Last commit message
Last commit date
PreferenceFragment
PreferenceFragment
 
 
PreferenceFragmentExample
PreferenceFragmentExample
 
 
appcompat_v7
appcompat_v7
 
 
download
download
 
 
gradle/wrapper
gradle/wrapper
 
 
screenshots
screenshots
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

###DEPRECATED

PreferenceFragment is deprecated. You can try https://github.com/jenzz/Android-MaterialPreference https://github.com/AndroidDeveloperLB/MaterialPreferenceLibrary https://github.com/Gericop/Android-Support-Preference-V7-Fix https://github.com/michael-rapp/AndroidPreferenceActivity

Thanks for all your support!

###Support PreferenceFragment

非官方PreferenceFragment兼容库,支持Android2.1及更高版本。

Unofficial PreferenceFragment compatibility layer for Android 2.1 and up.

###About the status of the library

弥补官方没有PreferenceFragment兼容库

我会一直维护它的
I will always maintain its

计划支持 Android L Material Design
Plans to support Android L Material Design


###Demo

二维码 Dimensional Code

Download Demo

###Usage

Add the following config in your build.gradle:

dependencies {
   compile 'com.android.support:appcompat-v7:20.0.0'
   compile 'cn.kongnannan:preferencefragment:1.1@aar'
}

Use it in your own code:

  import android.support.v4.preference.CheckBoxPreference;
  import android.support.v4.preference.EditTextPreference;
  import android.support.v4.preference.ListPreference;
  import android.support.v4.preference.PreferenceActivity;
  import android.support.v4.preference.PreferenceCategory;
  import android.support.v4.preference.PreferenceScreen;
  import android.support.v4.preference.SwitchPreference;
<PreferenceScreen xmlns:android1="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res-auto" >

    <PreferenceCategory
            android:title="@string/inline_preferences">
            
        <CheckBoxPreference
                android:key="checkbox_preference"
                android:title="@string/title_checkbox_preference"
                android:summary="@string/summary_checkbox_preference" />

        <SwitchPreference
                android:key="checkbox_preference"
                android:title="@string/title_switch_preference"
                android:summary="@string/summary_switch_preference" />

        <SwitchPreference
                android:key="checkbox_preference"
                android:title="@string/title_switch_preference"
                android:summary="@string/summary_switch_preference_yes_no"
                android:switchTextOn = "YES"
                android:switchTextOff = "NO"
                android:defaultValue="true" />
            
    </PreferenceCategory>
    
</PreferenceScreen>

Just extend PreferenceFragment and follow the Settings developer guide like if this layer wasn't even there to begin with.

http://developer.android.com/guide/topics/ui/settings.html

About me:

我来自孔孟之乡,六年代码生涯,略懂java、flex、php、javascript、html5、android等开发语言,热爱移动互联,目前从事Android开发

License

Copyright (c) 2014 Kong Nan

Licensed under the Apache License, Version 2.0

End

这是我自己APP的截图

alt tag

About

Unofficial Support PreferenceFragment compatibility layer for Android 2.1 and up.

Resources

Readme
Apache-2.0 license
Activity

Stars

42 stars

Watchers

3 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.