android {
//...
buildTypes {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.res.TypedArray; | |
import android.view.ContextThemeWrapper; | |
import android.util.AttributeSet; | |
import android.content.Context; | |
import android.preference.ListPreference; | |
public class ThemedListPreference extends ListPreference | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.takwolf.android.util; | |
import android.content.Context; | |
public class DisplayUtil { | |
/** | |
* 将px值转换为dip或dp值,保证尺寸大小不变 | |
*/ | |
public static int px2dip(Context context, float pxValue) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.io.OutputStreamWriter; | |
import java.io.PrintWriter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface AvailabilityChecker { | |
Observable<ValidationResult<String>> isEmailAvailable(@NonNull String email); | |
Observable<ValidationResult<String>> isUsernameAvailable(@NonNull String email); | |
ValidationResult<String> isEmailAvailableSync(@NonNull String email); | |
ValidationResult<String> isUsernameAvailableSync(@NonNull String email); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ContactHelper { | |
private static final String TAG = ContactHelper.class.getSimpleName(); | |
public static ModelContact getContactDetails(final Context context, String contactId) { | |
ModelContact contact = new ModelContact(); | |
contact.setContactId(contactId); | |
Cursor cursor = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI, |
Android has a dedicated XML namespace intended for tools to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. The namespace URI is http://schemas.android.com/tools and is usually bound to the tools: prefix:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Intent; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.ArrayAdapter; | |
import android.widget.Button; | |
import android.widget.ListView; | |
public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Preference { | |
static SharedPreferences _prefs; | |
static Map<String, dynamic> _memoryPrefs = Map<String, dynamic>(); | |
static Future<SharedPreferences> load() async { | |
if (_prefs == null) { | |
_prefs = await SharedPreferences.getInstance(); | |
} | |
return _prefs; | |
} |
OlderNewer