如您所知,Jalali 日历每四年有一次飞跃(当然,也有一些例外)
而不是一年 365 天,它有 366 天 :)
另一个问题是有些月份是 29 天,有些月份是 30 天,有些月份是 31 天:|
我使用矩库来生成这些日期(当然使用 fa 方法)
这个网站叫????? 做得很好。
var moment = require('moment-jalaali')
moment().format('jYYYY/jM/jD')
Run Code Online (Sandbox Code Playgroud)
现在我的问题是如何确定哪些月份是 29、30 和 31,哪一年是闰年?
因为所有片段一起加载在Pager Sliding选项卡中,我需要使用setUserVisibleHint()laoding选择的片段.我在setUserVisibleHint()方法中NPE Exception遇到了Context问题:当我getActivity用于Context 时它会引发.谢谢
为了创建图像幻灯片放映,我想使用带有计时器的图像切换器.我看过这篇博文非常清楚但它不会从网络加载图片.现在我想从Glide Library加载网络图像.
这是MainActivity:
public class MainActivity extends Activity {
private ImageSwitcher imageSwitcher;
private int[] gallery = { http://www.helloworld.com/image1.png, http://www.helloworld.com/image2.png, http://www.helloworld.com/image3.png,
http://www.helloworld.com/image4.png, };
private int position;
private static final Integer DURATION = 2500;
private Timer timer = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageSwitcher = (ImageSwitcher) findViewById(R.id.imageSwitcher);
imageSwitcher.setFactory(new ViewFactory() {
public View makeView() {
return new ImageView(MainActivity.this);
}
});
// Set animations
// https://danielme.com/2013/08/18/diseno-android-transiciones-entre-activities/
Animation fadeIn = AnimationUtils.loadAnimation(this, R.anim.fade_in);
Animation fadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out);
imageSwitcher.setInAnimation(fadeIn);
imageSwitcher.setOutAnimation(fadeOut); …Run Code Online (Sandbox Code Playgroud)