Skip to content
Permalink
Browse files

Initial Init

  • Loading branch information...
michaelachmann committed Jan 23, 2017
0 parents commit 729ac3a4a647513f8c056efde4f9e19f87080ed8
Showing with 1,670 additions and 0 deletions.
  1. +37 −0 .gitignore
  2. +34 −0 app/build.gradle
  3. +17 −0 app/proguard-rules.pro
  4. +26 −0 app/src/androidTest/java/de/hirtenstrasse/michael/lnkshortener/ExampleInstrumentedTest.java
  5. +43 −0 app/src/main/AndroidManifest.xml
  6. +109 −0 app/src/main/java/de/hirtenstrasse/michael/lnkshortener/AppCompatPreferenceActivity.java
  7. +230 −0 app/src/main/java/de/hirtenstrasse/michael/lnkshortener/DisplayShortenedUrlActivity.java
  8. +58 −0 app/src/main/java/de/hirtenstrasse/michael/lnkshortener/MainActivity.java
  9. +267 −0 app/src/main/java/de/hirtenstrasse/michael/lnkshortener/SettingsActivity.java
  10. +9 −0 app/src/main/res/drawable/ic_assignment_turned_in_black_24dp.xml
  11. +9 −0 app/src/main/res/drawable/ic_content_copy_black_24dp.xml
  12. +9 −0 app/src/main/res/drawable/ic_info_black_24dp.xml
  13. +9 −0 app/src/main/res/drawable/ic_language_black_24dp.xml
  14. +9 −0 app/src/main/res/drawable/ic_notifications_black_24dp.xml
  15. +9 −0 app/src/main/res/drawable/ic_share_black_24dp.xml
  16. +9 −0 app/src/main/res/drawable/ic_sync_black_24dp.xml
  17. +70 −0 app/src/main/res/layout/activity_display_shortened_url.xml
  18. +46 −0 app/src/main/res/layout/activity_main.xml
  19. BIN app/src/main/res/mipmap-hdpi/ic_launcher.png
  20. BIN app/src/main/res/mipmap-mdpi/ic_launcher.png
  21. BIN app/src/main/res/mipmap-xhdpi/ic_launcher.png
  22. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  23. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  24. +6 −0 app/src/main/res/values-w820dp/dimens.xml
  25. +6 −0 app/src/main/res/values/colors.xml
  26. +5 −0 app/src/main/res/values/dimens.xml
  27. +78 −0 app/src/main/res/values/strings.xml
  28. +11 −0 app/src/main/res/values/styles.xml
  29. +21 −0 app/src/main/res/xml/pref_data_sync.xml
  30. +33 −0 app/src/main/res/xml/pref_general.xml
  31. +20 −0 app/src/main/res/xml/pref_headers.xml
  32. +27 −0 app/src/main/res/xml/pref_notification.xml
  33. +17 −0 app/src/test/java/de/hirtenstrasse/michael/lnkshortener/ExampleUnitTest.java
  34. +23 −0 build.gradle
  35. BIN build/generated/mockable-android-25.jar
  36. +149 −0 build/intermediates/dex-cache/cache.xml
  37. +17 −0 gradle.properties
  38. BIN gradle/wrapper/gradle-wrapper.jar
  39. +6 −0 gradle/wrapper/gradle-wrapper.properties
  40. +160 −0 gradlew
  41. +90 −0 gradlew.bat
  42. +1 −0 settings.gradle
@@ -0,0 +1,37 @@
# Built application files
/*/build/

# Crashlytics configuations
com_crashlytics_export_strings.xml

# Local configuration file (sdk path, etc)
local.properties

# Gradle generated files
.gradle/

# Signing files
.signing/

# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
@@ -0,0 +1,34 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "de.hirtenstrasse.michael.lnkshortener"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.android.support:support-vector-drawable:25.1.0'
compile 'com.android.volley:volley:1.0.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
}
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /media/michael/LinuxData/Android/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -0,0 +1,26 @@
package de.hirtenstrasse.michael.lnkshortener;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("de.hirtenstrasse.michael.lnkshortener", appContext.getPackageName());
}
}
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.hirtenstrasse.michael.lnkshortener">

<uses-permission android:name="android.permission.INTERNET"/>


<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.hirtenstrasse.michael.lnkshortener.MainActivity" />
</activity>
<activity android:name=".DisplayShortenedUrlActivity">

<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
</activity><!-- ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>

</manifest>
@@ -0,0 +1,109 @@
package de.hirtenstrasse.michael.lnkshortener;

import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;

/**
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
* to be used with AppCompat.
*/
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {

private AppCompatDelegate mDelegate;

@Override
protected void onCreate(Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
}

@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}

public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}

public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}

@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}

@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}

@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}

@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}

@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}

@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}

@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
}

@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}

@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}

public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}

private AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null);
}
return mDelegate;
}
}
Oops, something went wrong.

0 comments on commit 729ac3a

Please sign in to comment.
You can’t perform that action at this time.