在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ankri/SwitchCompatLibrary开源软件地址(OpenSource Url):https://github.com/ankri/SwitchCompatLibrary开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Quick noteSadly I do not have the time to maintain the code any longer. Additionally I have not worked with Android for quite some time now. If you want to have a backport of the switch, please have a look at this project: https://github.com/Prototik/HoloEverywhere ##Switch for Froyo, Gingerbread & Honeycomb## A little while ago I started my own custom Switch button for Gingerbread. I wanted to have a switch button that always displays the texts on the left and right side. Since the standard Switch only shows the text from the currently selected side, I had to code my own version, which you can check out here: http://ankri.de/switch-button-for-android-2-3-gingerbread/ Unfortunately it isn't perfect. You cannot disable it for example, because I didn't need it in my use case. After I got some feedback, I decided to do a complete backport of the original Switch button, which was fairly easy! I just copied the code and edited some lines. I present to you the backport of the Switch button. Which has two minor limitations
Minor bugYeah. Unfortunately there is a minor bug aswell. For some reason the UsageThere are two projects. The Just download the project. If you’re using the Eclipse Development Environment with the ADT plugin version 0.9.7 or greater you can include the SwitchCompatLibrary as a library project. Create a new Android project in Eclipse using the SwitchCompatLibrary folder as the existing source. Then go to your project and in your project properties, add the created project under the ‘Libraries’ section of the ‘Android’ category. To use the Switch you have to configure your theme. There are several ways! Go to your 1. When not using any custom themeAndroidManifest.xml and edit the theme to this line:
android:theme="@style/AppThemeDark"for the dark theme or to: android:theme="@style/AppThemeLight"for the light theme. Go to your 2. When using a custom themestyles.xml and make either AppThemeDark or AppThemeLight the parent theme:
<style name="AppTheme" parent="AppThemeLight" />
Add the two lines to the style your 3. When using a custom theme and depending on a different parent like |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论