mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-19 21:10:11 -07:00
[MS OAuth] Open web to login
This commit is contained in:
parent
fa57a5f90c
commit
15123644a1
3 changed files with 37 additions and 0 deletions
35
app/src/main/java/net/kdt/pojavlaunch/CustomTabs.java
Normal file
35
app/src/main/java/net/kdt/pojavlaunch/CustomTabs.java
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.app.*;
|
||||
import android.content.*;
|
||||
import android.graphics.*;
|
||||
import android.net.*;
|
||||
import android.support.customtabs.*;
|
||||
import android.support.v4.content.*;
|
||||
import android.widget.*;
|
||||
import net.kdt.pojavlaunch.*;
|
||||
|
||||
public class CustomTabs {
|
||||
|
||||
public static void openTab(Context context, String url) {
|
||||
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
||||
builder.setShowTitle(true);
|
||||
|
||||
CustomTabsIntent customTabsIntent = builder.build();
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url));
|
||||
}
|
||||
|
||||
public static class CopyBroadcastReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String url = intent.getDataString();
|
||||
|
||||
ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData data = ClipData.newPlainText("Link", url);
|
||||
clipboardManager.setPrimaryClip(data);
|
||||
|
||||
Toast.makeText(context, "Copied " + url, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue