本文整理汇总了Java中com.devspark.appmsg.AppMsg.show方法的典型用法代码示例。如果您正苦于以下问题:Java AppMsg.show方法的具体用法?Java AppMsg.show怎么用?Java AppMsg.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.devspark.appmsg.AppMsg
的用法示例。
在下文中一共展示了AppMsg.show方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceive
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
// model finished load threads
Log.d("zen", "onReceive");
ZenMainActivity ac = (ZenMainActivity)mContext;
ac.showLoadingView(false);
mThreadsListView.onRefreshComplete();
String action = intent.getAction();
if (action.equals(ZenThreadsModel.DidFinishedLoad)) {
mThreadsAdapter.array = mModel.threads;
mThreadsAdapter.notifyDataSetChanged();
mList.scrollTo(0, 0);
}
else if(action.equals(ZenThreadsModel.DidFailedLoad)) {
AppMsg appmsg = AppMsg.makeText(ac, "����ʧ��...", AppMsg.STYLE_ALERT);
appmsg.show();
}
}
示例2: onReceive
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
System.out.println("Receive Notification: " + intent.getAction());
String action = intent.getAction();
mLoadingView.hide();
if (action.equals(ZenNotificationModel.ZEN_NEW_NOTIFICATION)) {
mAdapter.setNotifications(model.notifications);
mAdapter.notifyDataSetChanged();
}
else if (action.equals(ZenNotificationModel.ZEN_NOTIFICATION_EMPTY)) {
mAdapter.clear();
}
else if (action.equals(ZenNotificationModel.ZEN_LOAD_NOTIFICATION_FAILED)) {
AppMsg appmsg = AppMsg.makeText(ZenNotificationActivity.this, "�볡���Ѽ���ʧ��", AppMsg.STYLE_ALERT);
appmsg.show();
}
}
示例3: comment
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
private void comment() {
if (mModel.threadData.subject == null) {
AppMsg appMsg = AppMsg.makeText(this, "���Ӽ�����ɺ��������", AppMsg.STYLE_ALERT);
appMsg.show();
return;
}
if (isLogin()) {
Intent intent = new Intent(this, ZenPostActivity.class);
intent.putExtra("type", ZenPostActivity.ZEN_TYPE_COMMENT);
intent.putExtra("title", mModel.threadData.subject);
intent.putExtra("fid", mFid);
intent.putExtra("tid", mTid);
intent.putExtra("subject", mModel.threadData.subject);
intent.putExtra("pid", "");
startActivity(intent);
}
}
示例4: onPostExecute
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
@Override
protected void onPostExecute(String result) {
try {
result = result.trim();
String[] parts = result.split(":");
if (!parts[0].isEmpty() && !parts[1].isEmpty() && Integer.valueOf(parts[0]) > CURRENT_VERSION) {
// there's a new version
AppMsg appMsg = AppMsg.makeText(activity, activity.getString(R.string.new_version_detected)
+ " (" + parts[1] + ")", new AppMsg.Style(AppMsg.LENGTH_LONG, R.color.colorAccent));
appMsg.setLayoutGravity(Gravity.TOP);
appMsg.setDuration(8000); // 8 seconds
appMsg.getView().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(NOTES)));
}
});
if (preferences.getBoolean("transparent_nav", false) && activity.getResources()
.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
appMsg.setLayoutParams(Dimension.getParamsAppMsg(activity));
}
appMsg.show();
}
if (!parts[0].isEmpty())
preferences.edit().putLong("latest_update_check", System.currentTimeMillis()).apply();
} catch (Exception e) {
Log.e(TAG, "Sad face... Error", e);
} finally {
activity = null;
preferences = null;
}
}
示例5: save
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
private void save() {
if (!isExternalStorageWritable()) {
AppMsg appmsg = AppMsg.makeText(this, "����ʧ�ܣ������SD��",
AppMsg.STYLE_ALERT);
appmsg.show();
return;
}
if (isGif) {
saveGIF();
} else {
saveJPEG();
}
}
示例6: OnSendClick
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
@Override
public void OnSendClick(String content) {
ZenLoginModel loginModel = ZenLoginModel.getInstance();
String token = loginModel.userInfo.token;
if (content.matches("")) {
AppMsg appmsg = AppMsg.makeText(ZenContentActivity.this,
"����������...", AppMsg.STYLE_ALERT);
appmsg.show();
return;
}
switch (mType) {
case ZEN_TYPE_REPLY:
mLoading.show("���ڷ���...");
mCommentModel.comment(content, mReplyData.pid, token);
break;
case ZEN_TYPE_PM:
mLoading.show("���ڷ���...");
mCommentModel.send(content, "roger.qian");
break;
case ZEN_TYPE_COMMENT:
mLoading.show("���ڷ���...");
mCommentModel.comment(content, "", mModel.threadData.subject);
break;
case ZEN_TYPE_RECOMMEND:
mLoading.show("���ڷ���...");
mCommentModel.recommend(mModel.threadData.subject, content,
token);
break;
}
}
示例7: hint
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
private void hint() {
String json = ZenJSONUtil.ReadJSONFromFile(ZEN_FILE);
if (json == null || !json.contains("hint")) {
AppMsg msg = AppMsg.makeText(this, "���ҳ�룬ҳ����ת������...", AppMsg.STYLE_INFO);
msg.show();
}
}
示例8: validateNumber
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
private void validateNumber(View view, DocumentType documentType) {
String number = Functions.getCleanText(mEditText.getText().toString());
if (!Functions.isDocumentNumberReady(number)) {
setErrorMessage(getString(R.string.error_doc_invalid));
return;
}
AppMsg appMsg = null;
AppMsg.cancelAll(this);
AppMsg.Style style = new AppMsg.Style(AppMsg.LENGTH_SHORT, R.color.green_stuff);
String errorMessage = null;
switch (documentType) {
case BI:
if (ValidatorHelper.isNifOrBiValid(number)) {
appMsg = AppMsg.makeText(MainActivity.this, getString(R.string.valid_bi), style);
} else {
errorMessage = getString(R.string.error_bi);
}
break;
case NIF:
if (ValidatorHelper.isNifOrBiValid(number)) {
appMsg = AppMsg.makeText(MainActivity.this, getString(R.string.valid_nif), style);
} else {
errorMessage = getString(R.string.error_nif);
}
break;
case CC:
if (ValidatorHelper.isCcValid(number)) {
appMsg = AppMsg.makeText(MainActivity.this, getString(R.string.valid_cc), style);
} else {
errorMessage = getString(R.string.error_cc);
}
break;
case NISS:
if (ValidatorHelper.isNissValid(number)) {
appMsg = AppMsg.makeText(MainActivity.this, getString(R.string.valid_niss), style);
} else {
errorMessage = getString(R.string.error_niss);
}
break;
default:
}
if (appMsg != null) {
appMsg.getView().setOnClickListener(new CancelAppMsg(appMsg));
appMsg.setLayoutGravity(Gravity.BOTTOM);
appMsg.show();
}
invalidateViews((BetterButton) view, errorMessage);
}
示例9: onCreate
import com.devspark.appmsg.AppMsg; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setSupportProgressBarIndeterminate(true);
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_main);
context = this;
Global.setContext(context);
mNavigationDrawerFragment = (NavigationDrawerFragment)
getFragmentManager().findFragmentById(R.id.navigation_drawer);
mTitle = getTitle();
// Set up the drawer.
mNavigationDrawerFragment.setUp(
R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_layout));
if(!Global.userIsConnected()) onDisconnect();
// Volume
final View view = getLayoutInflater().inflate(R.layout.volume_action_view, null);
if(view != null) {
mVolumeControls = (SeekBar) view.findViewById(R.id.volume_control);
if (mVolumeControls != null) {
mVolumeControls.setMax(100);
mVolumeControls.setOnSeekBarChangeListener(this);
} else {
Toast.makeText(this, "Error findViewById for volume action view", Toast.LENGTH_SHORT).show();
}
// Apply the custom View to the ActionBar
getSupportActionBar().setCustomView(view, new ActionBar.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
}
ConnectivityManager connManager = (ConnectivityManager) Global.getStaticContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (mWifi != null && !mWifi.isConnected()) {
AppMsg.Style style = new AppMsg.Style(AppMsg.LENGTH_STICKY, R.color.alert_wifi);
AppMsg provided = AppMsg.makeText(this, R.string.wifi_error, style);
provided.getView()
.setOnClickListener(new CancelAppMsg(provided));
provided.show();
}
}