├── .gitignore ├── .travis.yml ├── Demo ├── context.gif ├── short.gif ├── shortNshare.gif └── widget.gif ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── codingblocks │ │ └── shortlr │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── codingblocks │ │ │ └── shortlr │ │ │ ├── ShortlrApp.java │ │ │ ├── Utils.java │ │ │ ├── activities │ │ │ ├── GetPermissionActivity.java │ │ │ ├── ShortenActivity.java │ │ │ └── ShortenAndShareActivity.java │ │ │ ├── api │ │ │ └── ShortenApi.java │ │ │ ├── models │ │ │ ├── PostBody.java │ │ │ └── Result.java │ │ │ ├── services │ │ │ └── CBWatcherService.java │ │ │ ├── watcher │ │ │ └── HomePressWatcher.java │ │ │ └── widget │ │ │ └── MyWidgetProvider.java │ └── res │ │ ├── drawable-hdpi │ │ ├── clipboard_paste_button_black.9.png │ │ ├── ic_arrow_back.png │ │ ├── ic_content_cut_black_24dp.png │ │ ├── ic_content_paste_black_24dp.png │ │ ├── ic_unfold_less.png │ │ └── scissors_black.9.png │ │ ├── drawable-mdpi │ │ ├── clipboard_paste_button_black.9.png │ │ ├── ic_arrow_back.png │ │ ├── ic_content_cut_black_24dp.png │ │ ├── ic_content_paste_black_24dp.png │ │ ├── ic_unfold_less.png │ │ └── scissors_black.9.png │ │ ├── drawable-xhdpi │ │ ├── clipboard_paste_button_black.9.png │ │ ├── ic_arrow_back.png │ │ ├── ic_content_cut_black_24dp.png │ │ ├── ic_content_paste_black_24dp.png │ │ ├── ic_unfold_less.png │ │ └── scissors_black.9.png │ │ ├── drawable-xxhdpi │ │ ├── clipboard_paste_button_black.9.png │ │ ├── ic_arrow_back.png │ │ ├── ic_content_cut_black_24dp.png │ │ ├── ic_content_paste_black_24dp.png │ │ ├── ic_unfold_less.png │ │ └── scissors_black.9.png │ │ ├── drawable-xxxhdpi │ │ ├── clipboard_paste_button_black.9.png │ │ ├── ic_arrow_back.png │ │ ├── ic_content_cut_black_24dp.png │ │ ├── ic_content_paste_black_24dp.png │ │ ├── ic_unfold_less.png │ │ └── scissors_black.9.png │ │ ├── drawable │ │ └── rounded_shape.xml │ │ ├── layout │ │ ├── activity_get_permission.xml │ │ ├── activity_main.xml │ │ ├── activity_shorten.xml │ │ ├── activity_shorten_and_share.xml │ │ ├── widget_layout.xml │ │ └── window_layout.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── widget_info.xml │ └── test │ └── java │ └── com │ └── codingblocks │ └── shortlr │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | ### JetBrains template 9 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 10 | 11 | *.iml 12 | 13 | ## Directory-based project format: 14 | .idea/ 15 | # if you remove the above rule, at least ignore the following: 16 | 17 | # User-specific stuff: 18 | # .idea/workspace.xml 19 | # .idea/tasks.xml 20 | # .idea/dictionaries 21 | 22 | # Sensitive or high-churn files: 23 | # .idea/dataSources.ids 24 | # .idea/dataSources.xml 25 | # .idea/sqlDataSources.xml 26 | # .idea/dynamic.xml 27 | # .idea/uiDesigner.xml 28 | 29 | # Gradle: 30 | # .idea/gradle.xml 31 | # .idea/libraries 32 | 33 | # Mongo Explorer plugin: 34 | # .idea/mongoSettings.xml 35 | 36 | ## File-based project format: 37 | *.ipr 38 | *.iws 39 | 40 | ## Plugin-specific files: 41 | 42 | # IntelliJ 43 | /out/ 44 | 45 | # mpeltonen/sbt-idea plugin 46 | .idea_modules/ 47 | 48 | # JIRA plugin 49 | atlassian-ide-plugin.xml 50 | 51 | # Crashlytics plugin (for Android Studio and IntelliJ) 52 | com_crashlytics_export_strings.xml 53 | crashlytics.properties 54 | crashlytics-build.properties 55 | ### Android template 56 | # Built application files 57 | *.apk 58 | *.ap_ 59 | 60 | # Files for the Dalvik VM 61 | *.dex 62 | 63 | # Java class files 64 | *.class 65 | 66 | # Generated files 67 | bin/ 68 | gen/ 69 | 70 | # Gradle files 71 | .gradle/ 72 | build/ 73 | 74 | # Local configuration file (sdk path, etc) 75 | local.properties 76 | 77 | # Proguard folder generated by Eclipse 78 | proguard/ 79 | 80 | # Log Files 81 | *.log 82 | 83 | # Android Studio Navigation editor temp files 84 | .navigation/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | script: "./gradlew clean assembleDebug" 8 | 9 | android: 10 | components: 11 | # Uncomment the lines below if you want to 12 | # use the latest revision of Android SDK Tools 13 | - tools 14 | - platform-tools 15 | 16 | # The BuildTools version used by your project 17 | - build-tools-25.0.2 18 | 19 | # The SDK version used to compile your project 20 | - android-25 21 | 22 | # Additional components 23 | # - extra-google-google_play_services 24 | # - extra-google-m2repository 25 | # - extra-android-m2repository 26 | # - addon-google_apis-google-19 27 | 28 | # Specify at least one system image, 29 | # if you need to run emulator(s) during your tests 30 | # - sys-img-armeabi-v7a-android-22 31 | # - sys-img-armeabi-v7a-android-17 32 | 33 | sudo: false 34 | -------------------------------------------------------------------------------- /Demo/context.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/Demo/context.gif -------------------------------------------------------------------------------- /Demo/short.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/Demo/short.gif -------------------------------------------------------------------------------- /Demo/shortNshare.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/Demo/shortNshare.gif -------------------------------------------------------------------------------- /Demo/widget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/Demo/widget.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shortlr 2 | 3 | This is the android client for Coding Blocks Shortlr ([Github](https://github.com/coding-blocks/shortlr) , [Webapp](https://cb.lk/admin)) 4 | 5 | ## Features 6 | 7 | #### 1. Home screen widget. 8 | 9 | ![](https://github.com/coding-blocks/shortlr_android_app/blob/master/Demo/widget.gif) 10 | 11 | #### 2. Shorten on go. 12 | 13 | ![](https://github.com/coding-blocks/shortlr_android_app/blob/master/Demo/short.gif) 14 | 15 | #### 3. Short and share. 16 | 17 | ![](https://github.com/coding-blocks/shortlr_android_app/blob/master/Demo/shortNshare.gif) 18 | 19 | #### 4. Clipboard listener. 20 | 21 | ![](https://github.com/coding-blocks/shortlr_android_app/blob/master/Demo/context.gif) 22 | 23 | ## For Contributors 24 | 25 | Any UI changes are welcome. Please add a screenshot with the PR if there are UI changes. -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "com.codingblocks.shortlr" 8 | minSdkVersion 16 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:25.3.0' 28 | compile 'com.squareup.retrofit2:retrofit:+' 29 | compile 'com.android.support:cardview-v7:25.3.0' 30 | compile 'com.squareup.retrofit2:converter-gson:+' 31 | compile 'com.android.support:palette-v7:25.3.0' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/piyush0/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/codingblocks/shortlr/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.codingblocks.shortlr", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/ShortlrApp.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr; 2 | 3 | import android.app.Application; 4 | import android.content.Intent; 5 | 6 | import com.codingblocks.shortlr.services.CBWatcherService; 7 | 8 | /** 9 | * Created by piyush0 on 30/05/17. 10 | */ 11 | 12 | public class ShortlrApp extends Application { 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | startWatcherService(); 18 | } 19 | 20 | private void startWatcherService() { 21 | Intent i = new Intent(this, CBWatcherService.class); 22 | startService(i); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/Utils.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr; 2 | 3 | import android.content.ClipData; 4 | import android.content.ClipboardManager; 5 | import android.content.Context; 6 | import android.util.Log; 7 | import android.widget.Toast; 8 | 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | import retrofit2.Call; 13 | import retrofit2.Callback; 14 | import retrofit2.Response; 15 | import retrofit2.Retrofit; 16 | import retrofit2.converter.gson.GsonConverterFactory; 17 | 18 | import static android.content.Context.CLIPBOARD_SERVICE; 19 | 20 | /** 21 | * Created by piyush0 on 11/04/17. 22 | */ 23 | 24 | public class Utils { 25 | 26 | public static String getFromClip(Context context) { 27 | String retVal = null; 28 | ClipboardManager myClipboard; 29 | myClipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE); 30 | ClipData abc = myClipboard.getPrimaryClip(); 31 | if (abc != null) { 32 | ClipData.Item item = abc.getItemAt(0); 33 | retVal = item.getText().toString(); 34 | } 35 | return retVal; 36 | } 37 | 38 | public static String saveToClipboard(String text, Context context) { 39 | ClipData myClip; 40 | 41 | myClip = ClipData.newPlainText("text", text); 42 | ClipboardManager myClipboard; 43 | myClipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE); 44 | myClipboard.setPrimaryClip(myClip); 45 | Toast.makeText(context, "Link copied to clipboard", Toast.LENGTH_SHORT).show(); 46 | return text; 47 | } 48 | 49 | public static String getHost(String url) { 50 | if (url == null || url.length() == 0) 51 | return ""; 52 | 53 | int doubleslash = url.indexOf("//"); 54 | if (doubleslash == -1) 55 | doubleslash = 0; 56 | else 57 | doubleslash += 2; 58 | 59 | int end = url.indexOf('/', doubleslash); 60 | end = end >= 0 ? end : url.length(); 61 | 62 | int port = url.indexOf(':', doubleslash); 63 | end = (port > 0 && port < end) ? port : end; 64 | 65 | return url.substring(doubleslash, end); 66 | } 67 | 68 | private static final String URL_REGEX = "^((https?|ftp)://|(www|ftp)\\.)?[a-z0-9-]+(\\.[a-z0-9-]+)+([/?].*)?$"; 69 | 70 | public static boolean isUrl(String str) { 71 | Pattern p = Pattern.compile(URL_REGEX); 72 | Matcher m = p.matcher(str);//replace with string to compare 73 | return m.find(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/activities/GetPermissionActivity.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.activities; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.net.Uri; 7 | import android.os.Build; 8 | import android.os.Bundle; 9 | import android.provider.Settings; 10 | 11 | import com.codingblocks.shortlr.R; 12 | 13 | public class GetPermissionActivity extends Activity { 14 | SharedPreferences sharedPreferences; 15 | private static final String SHARED_PREFS = "sp_permission_count"; 16 | private static final String PERMISSION = "Permission"; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_get_permission); 22 | 23 | sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE); 24 | 25 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 26 | if (!Settings.canDrawOverlays(GetPermissionActivity.this)) { 27 | int num = sharedPreferences.getInt(PERMISSION, 0); 28 | if (num == 0) { 29 | SharedPreferences.Editor editor = sharedPreferences.edit(); 30 | editor.putInt(PERMISSION, num + 1); 31 | editor.apply(); 32 | Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName())); 33 | startActivityForResult(intent, 0); 34 | finish(); 35 | } 36 | } 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/activities/ShortenActivity.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.activities; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.widget.Toast; 7 | 8 | import com.codingblocks.shortlr.R; 9 | import com.codingblocks.shortlr.Utils; 10 | import com.codingblocks.shortlr.api.ShortenApi; 11 | import com.codingblocks.shortlr.models.PostBody; 12 | import com.codingblocks.shortlr.models.Result; 13 | import com.codingblocks.shortlr.services.CBWatcherService; 14 | 15 | import retrofit2.Call; 16 | import retrofit2.Callback; 17 | import retrofit2.Response; 18 | import retrofit2.Retrofit; 19 | import retrofit2.converter.gson.GsonConverterFactory; 20 | 21 | public class ShortenActivity extends Activity { 22 | public static final String ACTION_MAIN = "android.intent.action.MAIN"; 23 | 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_shorten); 28 | 29 | 30 | if (getIntent().getAction().equals(ACTION_MAIN)) { 31 | // This is the for the first time app is launched. 32 | finish(); 33 | } else { 34 | String url = getIntent() 35 | .getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT).toString(); 36 | boolean readOnly = getIntent() 37 | .getBooleanExtra(Intent.EXTRA_PROCESS_TEXT_READONLY, false); 38 | if (Utils.isUrl(url)) { 39 | shorten(readOnly, url); 40 | } else { 41 | Toast.makeText(this, getString(R.string.not_a_url), Toast.LENGTH_SHORT).show(); 42 | finish(); 43 | } 44 | } 45 | } 46 | 47 | private void shorten(final Boolean readOnly, String urlToShort) { 48 | PostBody postBody = new PostBody(urlToShort, "", ""); 49 | String urlToPost = getString(R.string.api_endpoint); 50 | 51 | Retrofit retrofit = new Retrofit 52 | .Builder() 53 | .addConverterFactory(GsonConverterFactory.create()) 54 | .baseUrl(urlToPost) 55 | .build(); 56 | 57 | ShortenApi shortenApi = retrofit.create(ShortenApi.class); 58 | shortenApi.getResult(postBody).enqueue(new Callback() { 59 | 60 | @Override 61 | public void onResponse(Call call, Response response) { 62 | String replacementText = getString(R.string.short_code_prepend) + response.body().getShortcode(); 63 | if (readOnly) { 64 | Utils.saveToClipboard(replacementText, ShortenActivity.this); 65 | } 66 | Intent intent = new Intent(); 67 | intent.putExtra(Intent.EXTRA_PROCESS_TEXT, replacementText); 68 | setResult(RESULT_OK, intent); 69 | finish(); 70 | } 71 | 72 | @Override 73 | public void onFailure(Call call, Throwable t) { 74 | t.printStackTrace(); 75 | } 76 | }); 77 | } 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/activities/ShortenAndShareActivity.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.activities; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.LauncherApps; 7 | import android.content.pm.PackageManager; 8 | import android.content.pm.ResolveInfo; 9 | import android.os.Bundle; 10 | import android.os.Parcelable; 11 | import android.util.Log; 12 | import android.widget.Toast; 13 | 14 | import com.codingblocks.shortlr.models.PostBody; 15 | import com.codingblocks.shortlr.R; 16 | import com.codingblocks.shortlr.models.Result; 17 | import com.codingblocks.shortlr.api.ShortenApi; 18 | import com.codingblocks.shortlr.Utils; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import retrofit2.Call; 24 | import retrofit2.Callback; 25 | import retrofit2.Response; 26 | import retrofit2.Retrofit; 27 | import retrofit2.converter.gson.GsonConverterFactory; 28 | 29 | public class ShortenAndShareActivity extends Activity { 30 | 31 | @Override 32 | protected void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | setContentView(R.layout.activity_shorten_and_share); 35 | 36 | Intent intent = getIntent(); 37 | String action = intent.getAction(); 38 | String type = intent.getType(); 39 | 40 | if (Intent.ACTION_SEND.equals(action) && type != null) { 41 | if ("text/plain".equals(type)) { 42 | String urlToShort = intent.getStringExtra(Intent.EXTRA_TEXT); 43 | String hostName = Utils.getHost(urlToShort); 44 | if (hostName.equals("cb.lk")) { 45 | Toast.makeText(this, "Please use another app to share the link!", Toast.LENGTH_SHORT).show(); 46 | finish(); 47 | } else { 48 | PostBody postBody = new PostBody(urlToShort, "", ""); 49 | 50 | String urlToPost = getString(R.string.api_endpoint); 51 | Retrofit retrofit = new Retrofit 52 | .Builder() 53 | .addConverterFactory(GsonConverterFactory.create()) 54 | .baseUrl(urlToPost) 55 | .build(); 56 | ShortenApi shortenApi = retrofit.create(ShortenApi.class); 57 | 58 | shortenApi.getResult(postBody).enqueue(new Callback() { 59 | 60 | @Override 61 | public void onResponse(Call call, Response response) { 62 | 63 | String shortenedURL = getString(R.string.short_code_prepend) + response.body().getShortcode(); 64 | 65 | PackageManager pm = getPackageManager(); 66 | List targetIntents = new ArrayList(); 67 | 68 | Intent i = new Intent(Intent.ACTION_SEND); 69 | i.setType("text/plain"); 70 | List activities = pm.queryIntentActivities(i, 0); 71 | 72 | for (ResolveInfo currentInfo : activities) { 73 | String packageName = currentInfo.activityInfo.packageName; 74 | if (!getPackageName().equals(packageName)) { 75 | Intent targetIntent = new Intent(Intent.ACTION_SEND); // TRY ADDING EXPORT DATA ie url 76 | targetIntent.setType("text/plain"); 77 | targetIntent.putExtra(Intent.EXTRA_SUBJECT, "Sharing URL"); 78 | targetIntent.putExtra(Intent.EXTRA_TEXT, shortenedURL); 79 | targetIntent.setPackage(packageName); 80 | targetIntents.add(targetIntent); 81 | } 82 | } 83 | 84 | Intent chooserIntent = Intent.createChooser(targetIntents.remove(0), "Share URL"); 85 | chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetIntents.toArray(new Parcelable[] {})); 86 | startActivity(chooserIntent); 87 | finish(); 88 | } 89 | 90 | @Override 91 | public void onFailure(Call call, Throwable t) { 92 | t.printStackTrace(); 93 | } 94 | }); 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/api/ShortenApi.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.api; 2 | 3 | import com.codingblocks.shortlr.models.PostBody; 4 | import com.codingblocks.shortlr.models.Result; 5 | 6 | import retrofit2.Call; 7 | import retrofit2.http.Body; 8 | import retrofit2.http.POST; 9 | 10 | /** 11 | * Created by piyush0 on 11/04/17. 12 | */ 13 | 14 | public interface ShortenApi { 15 | @POST("shorten") 16 | Call getResult(@Body PostBody postBody); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/models/PostBody.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.models; 2 | 3 | /** 4 | * Created by piyush0 on 11/04/17. 5 | */ 6 | 7 | public class PostBody { 8 | private String url; 9 | private String secret; 10 | private String code; 11 | 12 | public PostBody(String url, String secret, String code) { 13 | this.url = url; 14 | this.secret = secret; 15 | this.code = code; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/models/Result.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.models; 2 | 3 | /** 4 | * Created by piyush0 on 11/04/17. 5 | */ 6 | 7 | public class Result { 8 | private String shortcode; 9 | private Boolean existed; 10 | private String longURL; 11 | 12 | public String getShortcode() { 13 | return shortcode; 14 | } 15 | 16 | public void setShortcode(String shortcode) { 17 | this.shortcode = shortcode; 18 | } 19 | 20 | public Boolean getExisted() { 21 | return existed; 22 | } 23 | 24 | public void setExisted(Boolean existed) { 25 | this.existed = existed; 26 | } 27 | 28 | public String getLongURL() { 29 | return longURL; 30 | } 31 | 32 | public void setLongURL(String longURL) { 33 | this.longURL = longURL; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/services/CBWatcherService.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.services; 2 | 3 | import android.app.Service; 4 | import android.content.ClipData; 5 | import android.content.ClipDescription; 6 | import android.content.ClipboardManager; 7 | import android.content.ClipboardManager.OnPrimaryClipChangedListener; 8 | import android.content.Context; 9 | import android.content.Intent; 10 | import android.graphics.Color; 11 | import android.os.Build; 12 | import android.os.IBinder; 13 | import android.provider.Settings; 14 | import android.view.Gravity; 15 | import android.view.KeyEvent; 16 | import android.view.View; 17 | import android.view.WindowManager; 18 | import android.view.animation.AccelerateDecelerateInterpolator; 19 | import android.view.animation.ScaleAnimation; 20 | import android.widget.ImageView; 21 | 22 | import com.codingblocks.shortlr.R; 23 | import com.codingblocks.shortlr.Utils; 24 | import com.codingblocks.shortlr.activities.GetPermissionActivity; 25 | import com.codingblocks.shortlr.api.ShortenApi; 26 | import com.codingblocks.shortlr.models.PostBody; 27 | import com.codingblocks.shortlr.models.Result; 28 | import com.codingblocks.shortlr.watcher.HomePressWatcher; 29 | 30 | import java.util.regex.Matcher; 31 | import java.util.regex.Pattern; 32 | 33 | import retrofit2.Call; 34 | import retrofit2.Callback; 35 | import retrofit2.Response; 36 | import retrofit2.Retrofit; 37 | import retrofit2.converter.gson.GsonConverterFactory; 38 | 39 | 40 | public class CBWatcherService extends Service { 41 | public static final String URL_REGEX = "^((https?|ftp)://|(www|ftp)\\.)?[a-z0-9-]+(\\.[a-z0-9-]+)+([/?].*)?$"; 42 | private WindowManager manager = null; 43 | private View view = null; 44 | private OnPrimaryClipChangedListener listener = new OnPrimaryClipChangedListener() { 45 | public void onPrimaryClipChanged() { 46 | 47 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 48 | if (Settings.canDrawOverlays(CBWatcherService.this)) { 49 | performClipboardCheck(); 50 | } else { 51 | Intent i = new Intent(CBWatcherService.this, GetPermissionActivity.class); 52 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 53 | startActivity(i); 54 | } 55 | } else { 56 | performClipboardCheck(); 57 | } 58 | } 59 | }; 60 | 61 | @Override 62 | public void onCreate() { 63 | ((ClipboardManager) getSystemService(CLIPBOARD_SERVICE)).addPrimaryClipChangedListener(listener); 64 | } 65 | 66 | @Override 67 | public int onStartCommand(Intent intent, int flags, int startId) { 68 | return START_STICKY; 69 | } 70 | 71 | @Override 72 | public IBinder onBind(Intent intent) { 73 | return null; 74 | } 75 | 76 | private void performClipboardCheck() { 77 | ClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); 78 | if (cb.hasPrimaryClip()) { 79 | ClipData cd = cb.getPrimaryClip(); 80 | 81 | if (cd.getDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) { 82 | String clipboardText = cd.getItemAt(0).getText().toString(); 83 | Pattern p = Pattern.compile(URL_REGEX); 84 | Matcher m = p.matcher(clipboardText); 85 | if (m.find()) { 86 | if (!Utils.getHost(clipboardText).equals(getString(R.string.host))) { 87 | showView(clipboardText); 88 | } 89 | } 90 | 91 | } 92 | } 93 | } 94 | 95 | public void showView(final String url) { 96 | manager = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); 97 | WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(); 98 | layoutParams.gravity = Gravity.CENTER; 99 | layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; 100 | layoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; 101 | layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT; 102 | layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT; 103 | layoutParams.alpha = 1.0f; 104 | layoutParams.packageName = getPackageName(); 105 | layoutParams.buttonBrightness = 1f; 106 | layoutParams.windowAnimations = android.R.style.Animation_Dialog; 107 | 108 | view = View.inflate(getApplicationContext(), R.layout.window_layout, null); 109 | ScaleAnimation scale = new ScaleAnimation(0, 1, 0, 1, ScaleAnimation.RELATIVE_TO_SELF, .5f, ScaleAnimation.RELATIVE_TO_SELF, .5f); 110 | scale.setDuration(300); 111 | scale.setInterpolator(new AccelerateDecelerateInterpolator()); 112 | view.startAnimation(scale); 113 | view.setBackgroundColor(Color.parseColor("#ffffff")); 114 | final HomePressWatcher homePressWatcher = new HomePressWatcher(view.getContext()); 115 | // solution for home button press and recentapps press 116 | homePressWatcher.setIntereceptor(new HomePressWatcher.onHomePressed() { 117 | @Override 118 | public void onHomeButtonPressed() { 119 | homePressWatcher.stopWatch(); 120 | removeView(); 121 | } 122 | }); 123 | homePressWatcher.startWatch(); 124 | // solution for back key press 125 | view.setOnKeyListener(new View.OnKeyListener() { 126 | @Override 127 | public boolean onKey(View v, int keyCode, KeyEvent event) { 128 | removeView(); 129 | return false; 130 | } 131 | }); 132 | view.requestFocus(); 133 | view.setFocusable(true); 134 | view.setFocusableInTouchMode(true); 135 | 136 | 137 | ImageView yesButton = (ImageView) view.findViewById(R.id.yesButton); 138 | ImageView noButton = (ImageView) view.findViewById(R.id.noButton); 139 | yesButton.setOnClickListener(new View.OnClickListener() { 140 | 141 | @Override 142 | public void onClick(View v) { 143 | PostBody postBody = new PostBody(url, null, null); 144 | 145 | String urlToPost = getString(R.string.api_endpoint); 146 | Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).baseUrl(urlToPost).build(); 147 | ShortenApi shortenApi = retrofit.create(ShortenApi.class); 148 | 149 | shortenApi.getResult(postBody).enqueue(new Callback() { 150 | 151 | @Override 152 | public void onResponse(Call call, Response response) { 153 | String shortUrl = getString(R.string.short_code_prepend) + response.body().getShortcode(); 154 | Utils.saveToClipboard(shortUrl, CBWatcherService.this); 155 | removeView(); 156 | 157 | } 158 | 159 | @Override 160 | public void onFailure(Call call, Throwable t) { 161 | t.printStackTrace(); 162 | } 163 | }); 164 | 165 | 166 | } 167 | }); 168 | noButton.setOnClickListener(new View.OnClickListener() { 169 | 170 | @Override 171 | public void onClick(View v) { 172 | removeView(); 173 | } 174 | }); 175 | manager.addView(view, layoutParams); 176 | } 177 | 178 | private void removeView() { 179 | if (view != null) { 180 | manager.removeView(view); 181 | view = null; 182 | } 183 | } 184 | 185 | 186 | } 187 | 188 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/watcher/HomePressWatcher.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.watcher; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.util.Log; 8 | import android.view.View; 9 | import android.view.Window; 10 | import android.view.WindowManager; 11 | 12 | /** 13 | * Created by panross on 22/5/17. 14 | */ 15 | 16 | public class HomePressWatcher { 17 | 18 | public interface onHomePressed{ 19 | void onHomeButtonPressed(); 20 | } 21 | 22 | 23 | Context context; 24 | onHomePressed interceptor; 25 | InterceptReceiver receiver; 26 | 27 | public HomePressWatcher(Context context) 28 | { 29 | this.context=context; 30 | } 31 | 32 | public void setIntereceptor(onHomePressed intereceptor) 33 | { 34 | this.interceptor=intereceptor; 35 | receiver=new InterceptReceiver(); 36 | } 37 | 38 | public void startWatch() 39 | { 40 | context.registerReceiver(receiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); 41 | } 42 | 43 | 44 | public void stopWatch() 45 | { 46 | context.unregisterReceiver(receiver); 47 | } 48 | 49 | class InterceptReceiver extends BroadcastReceiver { 50 | 51 | @Override 52 | public void onReceive(Context context, Intent intent) { 53 | String action=intent.getAction(); 54 | if(action.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) 55 | { 56 | String reason=intent.getStringExtra("reason"); 57 | if(reason.equals("homekey") || reason.equals("recentapps")) 58 | { 59 | interceptor.onHomeButtonPressed(); 60 | } 61 | } 62 | } 63 | } 64 | 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/codingblocks/shortlr/widget/MyWidgetProvider.java: -------------------------------------------------------------------------------- 1 | package com.codingblocks.shortlr.widget; 2 | 3 | import android.app.PendingIntent; 4 | import android.appwidget.AppWidgetManager; 5 | import android.appwidget.AppWidgetProvider; 6 | import android.content.ComponentName; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | import android.content.SharedPreferences; 10 | import android.util.Log; 11 | import android.widget.RemoteViews; 12 | import android.widget.Toast; 13 | 14 | import com.codingblocks.shortlr.models.PostBody; 15 | import com.codingblocks.shortlr.R; 16 | import com.codingblocks.shortlr.models.Result; 17 | import com.codingblocks.shortlr.api.ShortenApi; 18 | import com.codingblocks.shortlr.Utils; 19 | 20 | import retrofit2.Call; 21 | import retrofit2.Callback; 22 | import retrofit2.Response; 23 | import retrofit2.Retrofit; 24 | import retrofit2.converter.gson.GsonConverterFactory; 25 | 26 | /** 27 | * Created by piyush0 on 11/04/17. 28 | */ 29 | 30 | public class MyWidgetProvider extends AppWidgetProvider { 31 | 32 | private static final String ShortenClick = "myOnClickTag1"; 33 | private static final String PasteClick = "myOnClickTag2"; 34 | public static final String MyPREFERENCES = "Prefs"; 35 | 36 | 37 | @Override 38 | public void onUpdate(Context context, AppWidgetManager appWidgetManager, 39 | int[] appWidgetIds) { 40 | 41 | // Get all ids 42 | ComponentName thisWidget = new ComponentName(context, 43 | MyWidgetProvider.class); 44 | int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); 45 | for (int widgetId : allWidgetIds) { 46 | 47 | RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_layout); 48 | 49 | remoteViews.setOnClickPendingIntent(R.id.widget_btn_shorten, getPendingSelfIntent(context, ShortenClick)); 50 | remoteViews.setOnClickPendingIntent(R.id.widget_btn_paste, getPendingSelfIntent(context, PasteClick)); 51 | 52 | appWidgetManager.updateAppWidget(widgetId, remoteViews); 53 | 54 | } 55 | } 56 | 57 | protected PendingIntent getPendingSelfIntent(Context context, String action) { 58 | Intent intent = new Intent(context, getClass()); 59 | intent.setAction(action); 60 | return PendingIntent.getBroadcast(context, 0, intent, 0); 61 | } 62 | 63 | @Override 64 | public void onReceive(final Context context, Intent intent) { 65 | super.onReceive(context, intent); 66 | SharedPreferences sharedPreferences = context.getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE); 67 | String url = sharedPreferences.getString("url", ""); 68 | setTextOnTv(context, url); 69 | if (ShortenClick.equals(intent.getAction())) { 70 | if (!Utils.isUrl(url)) { 71 | Toast.makeText(context, "Not a url", Toast.LENGTH_SHORT).show(); 72 | } else { 73 | if (Utils.getHost(url).equals(context.getString(R.string.host))) { 74 | Toast.makeText(context, "Already a short url", Toast.LENGTH_SHORT).show(); 75 | } else { 76 | getShortenedUrl(url, context); 77 | } 78 | } 79 | 80 | } else if (PasteClick.equals(intent.getAction())) { 81 | 82 | String text = Utils.getFromClip(context); 83 | setTextOnTv(context, text); 84 | saveToSharedPrefs(text, context); 85 | } 86 | } 87 | 88 | private void saveToSharedPrefs(String str, Context context) { 89 | SharedPreferences sharedpreferences = context.getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE); 90 | SharedPreferences.Editor editor = sharedpreferences.edit(); 91 | editor.putString("url", str); 92 | editor.apply(); 93 | } 94 | 95 | private void setTextOnTv(Context context, String text) { 96 | RemoteViews views = new RemoteViews(context.getPackageName(), 97 | R.layout.widget_layout); 98 | views.setTextViewText(R.id.widget_tv_url, text); 99 | AppWidgetManager.getInstance(context).updateAppWidget( 100 | new ComponentName(context, MyWidgetProvider.class), views); 101 | } 102 | 103 | public void getShortenedUrl(String url, final Context context) { 104 | PostBody postBody = new PostBody(url, "", ""); 105 | final String[] shortURL = {""}; 106 | String urlToPost = context.getString(R.string.api_endpoint); 107 | Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create()).baseUrl(urlToPost).build(); 108 | ShortenApi shortenApi = retrofit.create(ShortenApi.class); 109 | 110 | shortenApi.getResult(postBody).enqueue(new Callback() { 111 | 112 | @Override 113 | public void onResponse(Call call, Response response) { 114 | shortURL[0] = context.getString(R.string.short_code_prepend) + response.body().getShortcode(); 115 | saveToSharedPrefs(shortURL[0], context); 116 | setTextOnTv(context, shortURL[0]); 117 | Utils.saveToClipboard(shortURL[0], context); 118 | } 119 | 120 | @Override 121 | public void onFailure(Call call, Throwable t) { 122 | t.printStackTrace(); 123 | } 124 | }); 125 | 126 | } 127 | 128 | 129 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clipboard_paste_button_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/clipboard_paste_button_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/ic_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_cut_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/ic_content_cut_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_content_paste_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/ic_content_paste_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_unfold_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/ic_unfold_less.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/scissors_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-hdpi/scissors_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/clipboard_paste_button_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/clipboard_paste_button_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/ic_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_cut_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/ic_content_cut_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_content_paste_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/ic_content_paste_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_unfold_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/ic_unfold_less.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/scissors_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-mdpi/scissors_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clipboard_paste_button_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/clipboard_paste_button_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/ic_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_cut_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/ic_content_cut_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_content_paste_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/ic_content_paste_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_unfold_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/ic_unfold_less.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/scissors_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xhdpi/scissors_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/clipboard_paste_button_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/clipboard_paste_button_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/ic_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_cut_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/ic_content_cut_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_content_paste_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/ic_content_paste_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_unfold_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/ic_unfold_less.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/scissors_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxhdpi/scissors_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/clipboard_paste_button_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/clipboard_paste_button_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_arrow_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/ic_arrow_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_content_cut_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/ic_content_cut_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_content_paste_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/ic_content_paste_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_unfold_less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/ic_unfold_less.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/scissors_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coding-blocks/shortlr_android_app/b560e64adde13bf53fc18b8b59019a291995f6b9/app/src/main/res/drawable-xxxhdpi/scissors_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounded_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_get_permission.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 |