1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-07-04 17:22:38 +02:00
dandelion/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java

48 lines
1.6 KiB
Java
Raw Normal View History

2016-03-03 17:46:31 +01:00
/*
This file is part of the Diaspora for Android.
2016-03-03 17:46:31 +01:00
Diaspora for Android is free software: you can redistribute it and/or modify
2016-03-03 17:46:31 +01:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Diaspora for Android is distributed in the hope that it will be useful,
2016-03-03 17:46:31 +01:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the Diaspora for Android.
2016-03-03 17:46:31 +01:00
If not, see <http://www.gnu.org/licenses/>.
*/
2016-03-29 19:38:50 +02:00
package com.github.dfa.diaspora_android.util;
2016-03-03 17:46:31 +01:00
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
2016-03-03 17:46:31 +01:00
import com.github.dfa.diaspora_android.R;
2016-07-18 14:02:18 +02:00
2016-03-03 17:46:31 +01:00
public class Helpers {
public static void animateToActivity(Activity from, Class to, boolean finishFromActivity) {
Intent intent = new Intent(from, to);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
from.startActivity(intent);
from.overridePendingTransition(R.anim.fadein, R.anim.fadeout);
if (finishFromActivity) {
from.finish();
}
}
public static void loadUrlInExternalBrowser(Context context, String url) {
try {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(browserIntent);
} catch (Exception ignored) {
}
}
2016-03-03 17:46:31 +01:00
}