在我的应用程序中,我想使用OpenWeatherMap api 来显示城市天气信息。
为此,我想将描述 语言更改为farsi。
我在OpenWeatherMap帮助下得到了这个,我在下面写了URL:
http://api.openweathermap.org/data/2.5/forecast/daily?q=tehran,ir&cnt=16&units=metric&lang=Farsi-fa&appid=1487dd8a93bfd85d278d9ayty875ghyy
Run Code Online (Sandbox Code Playgroud)
但是给我看这个信息:
{
"city": {
"id": 112931,
"name": "Tehran",
"coord": {
"lon": 51.4014,
"lat": 35.7006
},
"country": "IR",
"population": 7153309
},
"cod": "200",
"message": 1.31599,
"cnt": 16,
"list": [
{
"dt": 1522310400,
"temp": {
"day": 29.68,
"min": 9.13,
"max": 29.68,
"night": 9.13,
"eve": 19.21,
"morn": 29.68
},
"pressure": 749.02,
"humidity": 67,
"weather": [
{
"id": 801,
"main": "Clouds",
"description": "few clouds",
"icon": "02d" …Run Code Online (Sandbox Code Playgroud) 在我的项目中我想使用ProgressBar并且我想设置平滑倒计时动画。
我下面写的代码顺利动画,当一套1000毫秒(1秒)的时间演出顺利 animation,但我想要一套10000ms(10秒)的时间。
当持续时间设置为 10000 毫秒(10 秒)时,动画不流畅并显示片段倒计时。
但我想一套10000ms的时间,并显示顺利倒计时。
public class SimpleFrag extends Fragment {
TextView toolbar_title;
RelativeLayout toolbar;
private ProgressBar progressBar;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_simple, container, false);
ButterKnife.bind(this, view);
toolbar_title = getActivity().findViewById(R.id.toolbar_title);
toolbar = getActivity().findViewById(R.id.toolbar);
progressBar = view.findViewById(R.id.progress);
return view;
} …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我想向其中显示一些数据webView,为此,我webView从互联网上找到了习惯。
但是在此定制中,webView 不支持RTL语言并从左到右显示文本,但是我想从右到左显示。
自定义webView代码:
public class WebEngine {
private WebView webView;
private Activity mActivity;
private Context mContext;
private Fragment fragment;
public static final int KEY_FILE_PICKER = 554;
private static final String GOOGLE_DOCS_VIEWER = "https://docs.google.com/viewerng/viewer?url=";
//"http://docs.google.com/gview?embedded=true&url=";
// "http://drive.google.com/viewerng/viewer?embedded=true&url=";
private ValueCallback<Uri> mUploadMessage;
private ValueCallback<Uri[]> mFilePathCallback;
private WebListener webListener;
private String downloadUrl;
private VideoView videoView;
private WebChromeClient.CustomViewCallback videoViewCallback;
public WebEngine(WebView webView, Activity activity) {
this.webView = webView;
this.mActivity = activity;
this.mContext = mActivity.getApplicationContext(); …Run Code Online (Sandbox Code Playgroud)