本文整理汇总了Java中com.devspark.appmsg.AppMsg类的典型用法代码示例。如果您正苦于以下问题:Java AppMsg类的具体用法?Java AppMsg怎么用?Java AppMsg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppMsg类属于com.devspark.appmsg包,在下文中一共展示了AppMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case 0://小K授权
if (resultCode == Activity.RESULT_CANCELED) {
//获取授权失败
if (data == null) {
AppMsg.makeText(getActivity(), "获取授权失败,请检查网络", AppMsg.STYLE_CONFIRM).show();
} else {
AppMsg.makeText(getActivity(), "获取授权失败:" + data.getStringExtra(AtyOauth.RESULT_EXT_RESULT), AppMsg.STYLE_CONFIRM).show();
}
} else {
//获取授权成功
Settings.writeAuth(getActivity(), data.getStringExtra(AtyOauth.RESULT_EXT_USER_NAME),
data.getStringExtra(AtyOauth.RESULT_EXT_USER_ID),
data.getStringExtra(AtyOauth.RESULT_EXT_ACCESS_TOKEN),
data.getStringExtra(AtyOauth.RESULT_EXT_REFRESH_TOKEN),
data.getIntExtra(AtyOauth.RESULT_EXT_EXPIRES_IN, 0), System.currentTimeMillis());
getActivity().sendBroadcast(new Intent(Unit.ACTION_AUTH_OK));
loadDevices(false);
AppMsg.makeText(getActivity(), "授权成功:" + data.getStringExtra(AtyOauth.RESULT_EXT_USER_NAME), AppMsg.STYLE_INFO).show();
}
break;
}
}
示例2: showSuccessResult
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@UiThread
void showSuccessResult(BookModel.BookList l){
// new search
if(bookadapter == null){
count = l.getCount();
setListViewAdapter(l.getBooks());
String tips = getString(R.string.tips_searchbook_count) + count;
swipe_refresh.setRefreshing(false);
AppMsg.makeText(getSherlockActivity(),tips,AppMsg.STYLE_INFO).show();
}else{
// next page;
bookadapter.addAll(l.getBooks());
pullListView.onRefreshComplete();
bookadapter.notifyDataSetChanged();
adapter.notifyDataSetChanged();
}
}
示例3: showSuccessResult
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@UiThread
void showSuccessResult(CardRecordModel.RecordList l){
// new search
if(cardadapter == null){
count = l.getCount();
setListViewAdapter(l.getRecords());
String tips = getString(R.string.tips_card_record_count) + count;
AppMsg.makeText(getSherlockActivity(),tips,AppMsg.STYLE_INFO).show();
UIHelper.getDialog().dismiss();
}else{
// next page;
cardadapter.addAll(l.getRecords());
pullListView.onRefreshComplete();
cardadapter.notifyDataSetChanged();
adapter.notifyDataSetChanged();
pullListView.setRefreshing(false);
}
ActionBar actionBar = getSherlockActivity().getSupportActionBar();
actionBar.setSubtitle(getString(R.string.title_sub_card) + l.getAmount());
}
示例4: onSongDownload
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
public void onSongDownload(final Track t) {
t.setLocalPath(Environment.getExternalStorageDirectory() + "/" + Environment.DIRECTORY_MUSIC + "/" + t.getTitle() + ".mp3");
final ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setTitle("Please wait");
dialog.setMessage("Currently downloading " + t.getTitle() + "...");
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.show();
Ion.with(getActivity())
.load(t.getDownloadUrl())
.progressDialog(dialog)
.write(new File(t.getLocalPath()))
.setCallback(new FutureCallback<File>() {
@Override
public void onCompleted(Exception e, File file) {
t.save();
dialog.hide();
AppMsg.makeText(getActivity(), "Download complete!", AppMsg.STYLE_INFO).show();
EventBus.getDefault().post(new MusicDownloadedEvent(t.getLocalPath()));
}
});
}
示例5: onSongDownload
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
public void onSongDownload(final Track t) {
t.setLocalPath(Environment.getExternalStorageDirectory() + "/" + Environment.DIRECTORY_MUSIC + "/" + t.getTitle() + ".mp3");
final ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setTitle("Please wait");
dialog.setMessage("Currently downloading " + t.getTitle() + "...");
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.show();
Ion.with(getActivity())
.load(t.getDownloadUrl())
.progressDialog(dialog)
.write(new File(t.getLocalPath()))
.setCallback(new FutureCallback<File>() {
@Override
public void onCompleted(Exception e, File file) {
t.save();
dialog.hide();
AppMsg.makeText(getActivity(), "Download complete!", AppMsg.STYLE_INFO).show();
}
});
}
示例6: onSongDownload
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
public void onSongDownload(final Track t) {
t.setLocalPath(Environment.getExternalStorageDirectory() + "/" + Environment.DIRECTORY_MUSIC + "/" + t.getTitle() + ".mp3");
final ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setTitle("Please wait");
dialog.setMessage("Currently downloading " + t.getTitle() + "...");
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.show();
Ion.with(getActivity())
.load(t.getDownloadUrl())
.progressDialog(dialog)
.write(new File(t.getLocalPath()))
.setCallback(new FutureCallback<File>() {
@Override
public void onCompleted(Exception e, File file) {
dialog.hide();
AppMsg.makeText(getActivity(), "Download complete!", AppMsg.STYLE_INFO).show();
}
});
}
示例7: 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();
}
}
示例8: 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();
}
}
示例9: 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);
}
}
示例10: OnOpenVideo
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@JavascriptInterface
public void OnOpenVideo(String url) {
System.out.println("OnOpenVideo:" + url);
if (url != null) {
String videoUrl = ZenVideoParser.parser(url);
System.out.println("OnOpenVideo: after parser" + videoUrl);
if (videoUrl != null) {
mHandler.post(new ZenOpenChrome(ZenContentActivity.this, videoUrl));
}
else {
mHandler.post(new Runnable() {
@Override
public void run() {
AppMsg appmsg = AppMsg.makeText(ZenContentActivity.this,
"��ʱ��֧�ָ���Ƶ��ʽ", AppMsg.STYLE_ALERT);
appmsg.show();
}
});
}
}
}
示例11: run
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@Override
public void run()
{
if(result != null)
{
if(busTimes != null)
{
AppMsg.makeText((Activity) myContext, myContext.getString(R.string.info_successful), AppMsg.STYLE_INFO).show();
}
else
{
// Downloaded but couldn't be parsed
AppMsg.makeText((Activity) myContext, myContext.getString(R.string.info_noTimes), AppMsg.STYLE_CONFIRM).show();
}
((Times) myContext).updateInformation(myBus);
}
else
{
AppMsg.makeText((Activity) myContext, myContext.getString(R.string.error_noConnection), AppMsg.STYLE_ALERT).show();
}
((Times) myContext).toggleProgressBar(false);
myPtrView.onRefreshComplete();
}
示例12: run
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@Override
public void run()
{
if(result != null)
{
if(busses != null)
{
AppMsg.makeText((Activity) myContext, myContext.getString(R.string.info_successful), AppMsg.STYLE_INFO).show();
((Main) myContext).setBussesList(busses);
}
else
{
// Downloaded but couldn't be parsed
myPtrList.setAdapter(oldAdapter);
}
}
else
{
AppMsg.makeText((Activity) myContext, myContext.getString(R.string.error_noConnection), AppMsg.STYLE_ALERT).show();
}
((Main) myContext).toggleMode(false);
myPtrList.onRefreshComplete();
}
示例13: loginClick
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@Override
public void loginClick() {
final String email = binding.etEmail.getText().toString();
final String password = binding.etPassword.getText().toString();
if (TextUtils.isEmpty(email)) {
AppMsg.makeText(this, R.string.email_not_null, AppMsg.STYLE_ALERT).show();
return;
}
if (TextUtils.isEmpty(password)) {
AppMsg.makeText(this, R.string.password_not_null, AppMsg.STYLE_ALERT).show();
return;
}
mPresenter.login(email, password);
}
示例14: loginSuccess
import com.devspark.appmsg.AppMsg; //导入依赖的package包/类
@Override public void loginSuccess() {
AppMsg.makeText(this, getString(R.string.login_success), AppMsg.STYLE_INFO).show();
rx.Observable.just("").delay(300, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(s -> {
startActivity(new Intent(this, SearchActivity.class));
finish();
});
}
示例15: 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;
}
}