From ce950cadbfa532720dcb2da47d607c0de296aa31 Mon Sep 17 00:00:00 2001 From: Tomer Rosenfeld Date: Fri, 10 Mar 2017 20:44:33 +0200 Subject: [PATCH] Fixed gitignore, app code should now be available --- .gitignore | 2 - .../fadingtextview/MainActivity.java | 54 +++++++++++++++++++ app/src/main/res/drawable/ic_github.xml | 7 +++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/com/tomerrosenfeld/fadingtextview/MainActivity.java create mode 100644 app/src/main/res/drawable/ic_github.xml diff --git a/.gitignore b/.gitignore index 87d3d9d..65c70b3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,6 @@ .externalNativeBuild .idea app/libs/ -app/src/main/java/ -app/src/main/res/drawable/ private_key_sender.asc public_key_sender.asc *.jks diff --git a/app/src/main/java/com/tomerrosenfeld/fadingtextview/MainActivity.java b/app/src/main/java/com/tomerrosenfeld/fadingtextview/MainActivity.java new file mode 100644 index 0000000..fb61bcf --- /dev/null +++ b/app/src/main/java/com/tomerrosenfeld/fadingtextview/MainActivity.java @@ -0,0 +1,54 @@ +package com.tomerrosenfeld.fadingtextview; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; + +import com.tomer.fadingtextview.FadingTextView; + +import org.adw.library.widgets.discreteseekbar.DiscreteSeekBar; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + //FadingTextView related code + final FadingTextView fadingTextView = (FadingTextView) findViewById(R.id.fadingTextView); + fadingTextView.setTimeout(2, FadingTextView.TimeUnit.SECONDS); + //Setting up the timeout seek bar + DiscreteSeekBar seekBar = (DiscreteSeekBar) findViewById(R.id.timeout_bar); + seekBar.setOnProgressChangeListener(new DiscreteSeekBar.OnProgressChangeListener() { + @Override + public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) { + fadingTextView.setTimeout(value, FadingTextView.TimeUnit.SECONDS); + fadingTextView.forceRefresh(); + } + + @Override + public void onStartTrackingTouch(DiscreteSeekBar seekBar) { + + } + + @Override + public void onStopTrackingTouch(DiscreteSeekBar seekBar) { + + } + }); + //Setting up the Github Floating Action Button + findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.github.com/rosenpin/FadingTextView")); + browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(browserIntent); + } + }); + } +} diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml new file mode 100644 index 0000000..d2baa19 --- /dev/null +++ b/app/src/main/res/drawable/ic_github.xml @@ -0,0 +1,7 @@ + + +