use of vip.kuaifan.weiui.extend.bean.PageBean in project weiui by kuaifan.
the class weiuiPage method getWinInfo.
public static PageBean getWinInfo(String name) {
if (name == null) {
return null;
}
PageBean mBean = getPageBean(name);
if (mBean == null) {
return null;
}
Activity activity = mBean.getActivity();
if (activity == null) {
return null;
}
if (activity instanceof PageActivity) {
return ((PageActivity) activity).getPageInfo();
}
return null;
}
use of vip.kuaifan.weiui.extend.bean.PageBean in project weiui by kuaifan.
the class weiuiPage method closeWin.
public static void closeWin(String name) {
if (name == null) {
return;
}
PageBean mBean = getPageBean(name);
if (mBean == null) {
return;
}
Activity activity = mBean.getActivity();
if (activity == null) {
return;
}
activity.finish();
}
use of vip.kuaifan.weiui.extend.bean.PageBean in project weiui by kuaifan.
the class weiuiPage method reloadWin.
public static void reloadWin(String name) {
if (name == null) {
return;
}
PageBean mBean = getPageBean(name);
if (mBean == null) {
return;
}
Activity activity = mBean.getActivity();
if (activity == null) {
return;
}
if (activity instanceof PageActivity) {
((PageActivity) activity).reload();
}
}
use of vip.kuaifan.weiui.extend.bean.PageBean in project weiui by kuaifan.
the class weiuiPage method rewriteUrl.
public static String rewriteUrl(Context context, String url) {
if (url == null || url.startsWith("http") || url.startsWith("ftp://")) {
return url;
}
if (context instanceof PageActivity) {
PageBean info = ((PageActivity) context).getPageInfo();
if (info != null) {
try {
URL tmp = new URL(info.getUrl());
String newUrl = tmp.getProtocol() + "://" + tmp.getHost();
newUrl += (tmp.getPort() > -1 && tmp.getPort() != 80) ? (":" + tmp.getPort()) : "";
if (url.startsWith("/")) {
return newUrl + url;
} else {
String path = "/";
int lastIndex = tmp.getPath().lastIndexOf("/");
if (lastIndex > -1) {
path = tmp.getPath().substring(0, lastIndex + 1);
}
return newUrl + path + url;
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
return url;
}
use of vip.kuaifan.weiui.extend.bean.PageBean in project weiui by kuaifan.
the class WelcomeActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
View textView = findViewById(R.id.fullscreen_content);
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
AnimationSet animationSet = new AnimationSet(false);
animationSet.addAnimation(scaleAnimation);
animationSet.setDuration(1500);
animationSet.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
PageBean mBean = new PageBean();
// mBean.setUrl("http://192.168.2.125:8081/dist/index.js");
// mBean.setUrl("http://192.168.1.6:8081/dist/index.js");
mBean.setUrl("http://kuaifan.vip/weiui/dist/index.js");
mBean.setPageType("weex");
// mBean.setCache(24 * 60 * 60 * 1000);
weiuiPage.openWin(WelcomeActivity.this, mBean);
finish();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
textView.startAnimation(animationSet);
}
Aggregations