参考链接,位于“更新的材料样式”下(对于FAB):https://material.io/develop/android/components/floating-action-button/
在上面的链接中:“ public void sendGet(final JSONObject jsonObject) {
mAPIService.getCall("Basic mybasicauthenticationtoken", "Fetch").enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
if(response.isSuccessful()) {
System.out.println(response.headers().get("X-CSRF-Token"));
Log.i(TAG, "get submitted to API." );
token = response.headers().get("X-CSRF-Token");
Log.i(TAG, "TOKEN = " + token );
mAPIService.savePost("Basic mybasicauthenticationtoken", token, jsonObject.toString()).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) {
if(response.isSuccessful()) {
System.out.println(response.body().toString());
Log.i(TAG, "post submitted to API." + response.body().toString());
}
try {
System.out.println(response.errorBody().string());
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void onFailure(Call call, Throwable t) {
System.out.println("ERROR POST");
Log.e(TAG, "Unable to submit post to API.");
}
});
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Log.e(TAG, "Unable to submit get to API.");
t.printStackTrace();
}
});
使用更新的Material主题(主题。 MaterialComponents ,不是Theme。 Material )将提供正确的更新Material样式。转到默认的浮动操作按钮。”
我的应用目标API级别为14到28。
我应该为MaskFormatter latitudeformat=new MaskFormatter("*##.######");
**latitudeformat.setValidCharacters("-+1234567890");**
MaskFormatter longitudeformat=new MaskFormatter("*###.######");
**longitudeformat.setValidCharacters("-+1234567890");**
latitudeformat.setPlaceholderCharacter('0');
latitudeformat.setOverwriteMode(true);
longitudeformat.setPlaceholderCharacter('0');
longitudeformat.setOverwriteMode(true);
创建FloatingActionButton
吗?
使用该功能代替AppCompat是否有任何优势(当前或将来计划)?
一个包含另一个吗?