Skip to content
Permalink
Browse files

Added Github features

  • Loading branch information...
michaelachmann committed Jan 31, 2017
1 parent 8c96e8b commit 0a839aa85e0198063394f7c693d3387cfcf75b8f
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
@@ -29,6 +29,7 @@ dependencies {
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'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
testCompile 'junit:junit:4.12'
}
@@ -0,0 +1,4 @@
<div style="width: 100%; margin-left: auto; margin-right:auto; margin: 0 auto; text-align: center">
<iframe src="https://ghbtns.com/github-btn.html?user=michaelachmann&repo=lnkshortener&type=star&count=true" frameborder="0" align="center" scrolling="0" width="80px" height="20px"></iframe>
</div>

@@ -17,6 +17,7 @@

import android.app.FragmentTransaction;
import android.content.Intent;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@@ -156,6 +157,15 @@ public boolean onOptionsItemSelected(MenuItem item) {

return true;

case R.id.action_bug:

String url = "https://github.com/michaelachmann/LnkShortener/issues/new";
Intent intentBug = new Intent(Intent.ACTION_VIEW);
intentBug.setData(Uri.parse(url));
startActivity(intentBug);

return true;

default:
// If we got here, the user's action was not recognized.
// Invoke the superclass to handle it.
@@ -20,6 +20,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
@@ -34,6 +35,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Since might want to alter some values in the layout we need the Inflater as a variable
View myInflater = inflater.inflate(R.layout.fragment_main, container, false);

// Adding the Github Buttons
WebView webview = (WebView) myInflater.findViewById(R.id.webViewGithub);
webview.getSettings().setJavaScriptEnabled(true);
webview.setBackgroundColor(0x00000000);


webview.loadUrl("file:///android_asset/github.html");


// If errors have been passed to the Activity they can be injected into the Fragment at this
// position. That's why we first check for errors and thereafter alter the Labels in the layout
if(getArguments().getBoolean("error")){
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>
</vector>
@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:id="@+id/mainFrame"
android:layout_height="match_parent"
tools:context="de.hirtenstrasse.michael.lnkshortener.MainFragment">

@@ -63,6 +64,16 @@
android:textAlignment="center"
android:onClick="shortenLink"/>


</LinearLayout>


<WebView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom"
app:layout_anchor="@+id/mainFrame"
app:layout_anchorGravity="bottom|end"
android:id="@+id/webViewGithub" />

</FrameLayout>
@@ -4,9 +4,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
>

<item android:id="@+id/action_history"
android:title="@string/action_history"
app:showAsAction="always"

android:icon="@drawable/ic_history_white_24dp"
/>

<!-- Settings, should always be in the overflow -->
<item android:id="@+id/action_settings"
android:title="@string/activity_settings"
app:showAsAction="never"/>

<item android:id="@+id/action_bug"
android:title="@string/action_bug"
app:showAsAction="never"/>
</menu>
@@ -1,6 +1,10 @@
<resources>
<string name="app_name">LnkShortener</string>

<!-- String for Menu in MainActivity -->
<string name="action_bug">Report a Bug</string>
<string name="activity_settings">Settings</string>
<string name="action_history">History</string>

<!-- Strings for MainActivity -->
<string name="shorten">SHORTEN</string>
Binary file not shown.
Binary file not shown.
@@ -1,20 +1,41 @@
.. LnkShortener documentation master file, created by
sphinx-quickstart on Mon Jan 30 12:26:56 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
$project
========

Welcome to LnkShortener's documentation!
========================================
$project will solve your problem of where to start with documentation,
by providing a basic explanation of how to do it easily.

.. toctree::
:maxdepth: 2
:caption: Contents:
Look how easy it is to use:

import project
# Get your stuff done
project.do_stuff()

Features
--------

Indices and tables
==================
- Be awesome
- Make things faster

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Installation
------------

Install $project by running:

install project

Contribute
----------

- Issue Tracker: github.com/$project/$project/issues
- Source Code: github.com/$project/$project

Support
-------

If you are having issues, please let us know.
We have a mailing list located at: project@google-groups.com

License
-------

The project is licensed under the BSD license.
@@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Welcome to LnkShortener’s documentation! &#8212; LnkShortener 1.0 documentation</title>
<title>$project &#8212; LnkShortener 1.0 documentation</title>

<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -41,18 +41,44 @@
<div class="bodywrapper">
<div class="body" role="main">

<div class="section" id="welcome-to-lnkshortener-s-documentation">
<h1>Welcome to LnkShortener&#8217;s documentation!<a class="headerlink" href="#welcome-to-lnkshortener-s-documentation" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
<div class="section" id="project">
<h1>$project<a class="headerlink" href="#project" title="Permalink to this headline">¶</a></h1>
<p>$project will solve your problem of where to start with documentation,
by providing a basic explanation of how to do it easily.</p>
<p>Look how easy it is to use:</p>
<blockquote>
<div>import project
# Get your stuff done
project.do_stuff()</div></blockquote>
<div class="section" id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Be awesome</li>
<li>Make things faster</li>
</ul>
</div>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>Install $project by running:</p>
<blockquote>
<div>install project</div></blockquote>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<div class="section" id="contribute">
<h2>Contribute<a class="headerlink" href="#contribute" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
<li>Issue Tracker: github.com/$project/$project/issues</li>
<li>Source Code: github.com/$project/$project</li>
</ul>
</div>
<div class="section" id="support">
<h2>Support<a class="headerlink" href="#support" title="Permalink to this headline">¶</a></h2>
<p>If you are having issues, please let us know.
We have a mailing list located at: <a class="reference external" href="mailto:project&#37;&#52;&#48;google-groups&#46;com">project<span>&#64;</span>google-groups<span>&#46;</span>com</a></p>
</div>
<div class="section" id="license">
<h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
<p>The project is licensed under the BSD license.</p>
</div>
</div>


@@ -63,8 +89,14 @@ <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Pe
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to LnkShortener&#8217;s documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
<li><a class="reference internal" href="#">$project</a><ul>
<li><a class="reference internal" href="#features">Features</a></li>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#contribute">Contribute</a></li>
<li><a class="reference internal" href="#support">Support</a></li>
<li><a class="reference internal" href="#license">License</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
BIN -29 Bytes (89%) docs/_build/html/objects.inv
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,20 +1,41 @@
.. LnkShortener documentation master file, created by
sphinx-quickstart on Mon Jan 30 12:26:56 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
$project
========

Welcome to LnkShortener's documentation!
========================================
$project will solve your problem of where to start with documentation,
by providing a basic explanation of how to do it easily.

.. toctree::
:maxdepth: 2
:caption: Contents:
Look how easy it is to use:

import project
# Get your stuff done
project.do_stuff()

Features
--------

Indices and tables
==================
- Be awesome
- Make things faster

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Installation
------------

Install $project by running:

install project

Contribute
----------

- Issue Tracker: github.com/$project/$project/issues
- Source Code: github.com/$project/$project

Support
-------

If you are having issues, please let us know.
We have a mailing list located at: project@google-groups.com

License
-------

The project is licensed under the BSD license.

0 comments on commit 0a839aa

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