mirror of https://github.com/iSoron/uhabits.git
parent
aaf2789a21
commit
e0527dc8ff
@ -0,0 +1,93 @@
|
|||||||
|
/* Copyright (C) 2016 Alinson Santos Xavier
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.isoron.uhabits;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.isoron.helpers.ColorHelper;
|
||||||
|
|
||||||
|
public class AboutActivity extends Activity implements View.OnClickListener
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState)
|
||||||
|
{
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.about);
|
||||||
|
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= 21)
|
||||||
|
{
|
||||||
|
int color = getResources().getColor(R.color.blue_700);
|
||||||
|
int darkerColor = ColorHelper.mixColors(color, Color.BLACK, 0.75f);
|
||||||
|
getActionBar().setBackgroundDrawable(new ColorDrawable(color));
|
||||||
|
getWindow().setStatusBarColor(darkerColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView tvVersion = (TextView) findViewById(R.id.tvVersion);
|
||||||
|
TextView tvRate = (TextView) findViewById(R.id.tvRate);
|
||||||
|
TextView tvFeedback = (TextView) findViewById(R.id.tvFeedback);
|
||||||
|
TextView tvSource = (TextView) findViewById(R.id.tvSource);
|
||||||
|
|
||||||
|
tvVersion.setText(String.format("%s %s", getResources().getString(R.string.version),
|
||||||
|
BuildConfig.VERSION_NAME));
|
||||||
|
tvRate.setOnClickListener(this);
|
||||||
|
tvFeedback.setOnClickListener(this);
|
||||||
|
tvSource.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v)
|
||||||
|
{
|
||||||
|
switch (v.getId())
|
||||||
|
{
|
||||||
|
case R.id.tvRate:
|
||||||
|
{
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
intent.setData(Uri.parse("market://details?id=org.isoron.uhabits"));
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case R.id.tvFeedback:
|
||||||
|
{
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_SENDTO);
|
||||||
|
intent.setData(Uri.parse("mailto:isoron+habits@gmail.com?" +
|
||||||
|
"subject=Feedback%20about%20Loop%20Habit%20Tracker"));
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case R.id.tvSource:
|
||||||
|
{
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Intent.ACTION_VIEW);
|
||||||
|
intent.setData(Uri.parse("https://github.com/iSoron/uhabits"));
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:background="@color/windowBackground"
|
||||||
|
android:fillViewport="true">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
style="@style/cardsListStyle">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
style="@style/cardStyle"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:src="@drawable/intro_icon_1"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_margin="6dp"
|
||||||
|
android:textColor="@color/blue_700"
|
||||||
|
android:text="@string/app_name"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvVersion"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text=""/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
style="@style/cardStyle"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/cardHeaderStyle"
|
||||||
|
android:text="@string/links"
|
||||||
|
android:textColor="@color/blue_700"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvRate"
|
||||||
|
style="@style/aboutClickableItemStyle"
|
||||||
|
android:text="@string/pref_rate_this_app"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvFeedback"
|
||||||
|
style="@style/aboutClickableItemStyle"
|
||||||
|
android:text="@string/pref_send_feedback"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSource"
|
||||||
|
style="@style/aboutClickableItemStyle"
|
||||||
|
android:text="@string/pref_view_source_code"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
style="@style/cardStyle"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/cardHeaderStyle"
|
||||||
|
android:text="@string/developers"
|
||||||
|
android:textColor="@color/blue_700"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/aboutItemStyle"
|
||||||
|
android:text="Álinson Xavier"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
style="@style/cardStyle"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/cardHeaderStyle"
|
||||||
|
android:text="@string/translators"
|
||||||
|
android:textColor="@color/blue_700"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/aboutItemStyle"
|
||||||
|
android:text="Limin Lu (中文)"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/aboutItemStyle"
|
||||||
|
android:text="Álinson Xavier (Português)"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
Loading…
Reference in new issue