In your command-line run the following commands:
brew doctor
brew update
// Copied from https://github.com/ToxicBakery/ViewPagerTransforms | |
@SuppressWarnings("WeakerAccess") | |
public abstract class BaseTransformer implements PageTransformer { | |
public static final float DAMPING_RATIO_NO_BOUNCY = 1f; | |
/** | |
* Called each {@link #transformPage(View, float)}. | |
* | |
* @param view the view |
import glob | |
import csv | |
dictCSV = "C:/path/to/androidx-class-mapping.csv" | |
projectPath = "C:/path/to/project/src/" | |
def replace_all(text, dic): | |
for i, j in dic.items(): | |
text = text.replace(i, j) | |
return text |
#!/usr/bin/env bash | |
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
# well, so I wrote my own script to do the simple job of converting package names. | |
# | |
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
# | |
# It'll run faster on a clean build because then there are fewer files to scan over. | |
# | |
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
In your command-line run the following commands:
brew doctor
brew update
/** | |
*最近在研究网络请求数据解析的问题,发现json数据被强制转换为map结构的时候,会出现int变成double的问题 | |
*在stackoverflow上看到了一个这个How can I prevent gson from converting integers to doubles 的问题,采用了这个答案 | |
*https://stackoverflow.com/a/36529534/5279354答案 | |
*/ | |
import com.google.gson.JsonArray; | |
import com.google.gson.JsonDeserializationContext; | |
import com.google.gson.JsonDeserializer; | |
import com.google.gson.JsonElement; |
package com.cjtp.android.api.interceptors; | |
import android.util.Log; | |
import com.google.gson.JsonObject; | |
import com.inviteez.android.core.Session; | |
import com.inviteez.android.utils.Constant; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.IOException; |
public class LowercaseEnumTypeAdapterFactory implements TypeAdapterFactory { | |
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { | |
Class<T> rawType = (Class<T>) type.getRawType(); | |
if (!rawType.isEnum()) { | |
return null; | |
} | |
final Map<String, T> lowercaseToConstant = new HashMap<String, T>(); | |
for (T constant : rawType.getEnumConstants()) { | |
lowercaseToConstant.put(toLowercase(constant), constant); |
/** | |
_____ _____ _ | |
| __ \ / ____| | | | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __ | |
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__| | |
| |__| | __/ |____| | | |_| | |_) | || (_) | | | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_| | |
__/ | | | |
|___/|_| | |
*/ |
/** | |
* 通过反射修改TabLayout Indicator的宽度(仅在Android 4.2及以上生效) | |
*/ | |
private void setUpIndicatorWidth() { | |
Class<?> tabLayoutClass = tabLayout.getClass(); | |
Field tabStrip = null; | |
try { | |
tabStrip = tabLayoutClass.getDeclaredField("mTabStrip"); | |
tabStrip.setAccessible(true); | |
} catch (NoSuchFieldException e) { |