使用Theme.MaterialComponents代替Theme.AppCompat有什么好处?

时间:2018-07-20 10:47:42

标签: android material-design floating-action-button

参考链接,位于“更新的材料样式”下(对于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是否有任何优势(当前或将来计划)?

一个包含另一个吗?

0 个答案:

没有答案