Compare commits
No commits in common. "42ca1a016c4c853bd6fac4b4165a92d27bb12ec4" and "84d405d5d67579f4c7d0f7be425f6d0d4703b41c" have entirely different histories.
42ca1a016c
...
84d405d5d6
|
@ -27,7 +27,7 @@ stages:
|
|||
|
||||
assembleDebug:
|
||||
stage: build
|
||||
script: ./gradlew assembleDebug && mv app/build/outputs/apk/debug/app-debug.apk unshortify.apk
|
||||
script: ./gradlew assembleDebug
|
||||
artifacts:
|
||||
paths:
|
||||
- unshortify.apk
|
||||
- app/build/outputs/apk/debug/*.apk
|
||||
|
|
|
@ -6,23 +6,12 @@ import android.widget.Toast;
|
|||
import android.content.Intent;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.blankie.unshortify.R;
|
||||
|
||||
public class ShareActivity extends Activity {
|
||||
public static final String TAG = "unshortify";
|
||||
|
||||
private void logVariable(final String name, final String value) {
|
||||
String msg = name + " = ";
|
||||
if (value != null) {
|
||||
msg += "[" + value + "]";
|
||||
} else {
|
||||
msg += "null";
|
||||
}
|
||||
Log.d(TAG, msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -30,7 +19,6 @@ public class ShareActivity extends Activity {
|
|||
try {
|
||||
final Intent intent = getIntent();
|
||||
final String urlString = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||
logVariable("urlString", urlString);
|
||||
if (urlString == null || urlString == "") {
|
||||
Toast.makeText(getApplicationContext(), R.string.empty_url,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
|
@ -38,7 +26,6 @@ public class ShareActivity extends Activity {
|
|||
}
|
||||
|
||||
final Uri urlParsed = Uri.parse(urlString);
|
||||
logVariable("scheme", urlParsed.getScheme());
|
||||
if (urlParsed.getScheme() != "http" && urlParsed.getScheme() != "https" &&
|
||||
urlParsed.getScheme() != "") {
|
||||
Toast.makeText(getApplicationContext(), R.string.unknown_scheme,
|
||||
|
@ -46,7 +33,6 @@ public class ShareActivity extends Activity {
|
|||
return;
|
||||
}
|
||||
|
||||
logVariable("host", urlParsed.getHost());
|
||||
if (urlParsed.getHost() == null || (urlParsed.getHost() != "youtube.com" &&
|
||||
urlParsed.getHost().endsWith(".youtube.com"))) {
|
||||
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
|
||||
|
@ -54,7 +40,6 @@ public class ShareActivity extends Activity {
|
|||
return;
|
||||
}
|
||||
|
||||
logVariable("path", urlParsed.getPath());
|
||||
if (urlParsed.getPath() == null) {
|
||||
Toast.makeText(getApplicationContext(), R.string.null_path,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
|
|
Loading…
Reference in New Issue