Merge pull request #170 from secretrobotron/t137

Welcome screen
This commit is contained in:
Brian Mwadime 2016-07-16 09:40:26 +03:00 коммит произвёл GitHub
Родитель 013717da59 e3842d1158
Коммит 87838254e4
7 изменённых файлов: 114 добавлений и 1 удалений

Просмотреть файл

@ -22,7 +22,12 @@
<activity
android:name=".activities.IconQuizActivity"
android:label="@string/title_activity_iconquiz"
android:windowSoftInputMode="stateHidden"></activity>
android:windowSoftInputMode="stateHidden"/>
<activity
android:name=".activities.WelcomeActivity"
android:label="@string/title_activity_iconquiz"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".activities.DashboardActivity"
android:label="Jisort - What would you like to do?"

Просмотреть файл

@ -1,5 +1,7 @@
package com.mozilla.hackathon.kiboko.activities;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
@ -13,11 +15,14 @@ public class DashboardActivity extends DSOActivity {
public static FragmentActivity mDashboard;
private String TAG = DashboardActivity.class.getSimpleName();
SharedPreferences prefs = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dashboard_layout);
mDashboard = DashboardActivity.this;
prefs = getSharedPreferences("com.mycompany.myAppName", MODE_PRIVATE);
Analytics.add("Dashboard", "create");
}
@ -26,6 +31,13 @@ public class DashboardActivity extends DSOActivity {
{
super.onResume();
active = true;
if (prefs.getBoolean("firstrun", true)) {
prefs.edit().putBoolean("firstrun", false).commit();
Intent intent = new Intent(DashboardActivity.this, WelcomeActivity.class);
startActivity(intent);
finish();
}
}
@Override

Просмотреть файл

@ -0,0 +1,29 @@
package com.mozilla.hackathon.kiboko.activities;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.mozilla.hackathon.kiboko.R;
/**
* Created by secretrobotron on 7/15/16.
*/
public class WelcomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
ActionBar ab = getSupportActionBar();
ab.setDisplayHomeAsUpEnabled(true);
}
public void dismissWelcome(View view){
Intent intent = new Intent(WelcomeActivity.this, DashboardActivity.class);
startActivity(intent);
finish();
}
}

Двоичные данные
app/src/main/res/drawable-nodpi/welcome.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 80 KiB

Просмотреть файл

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorPrimary">
<ImageView
android:id="@+id/topic_icon"
android:src="@drawable/welcome"
android:layout_marginTop="15dp"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:text="@string/welcome_surtitle"
android:textColor="@color/colorTextPrimary"
android:textSize="@dimen/text_size_xlarge"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:text="@string/welcome_title"
android:textColor="@color/colorIcons"
android:textSize="@dimen/text_size_xxlarge"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_margin="@dimen/activity_vertical_margin"
android:id="@+id/quizResult"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="@color/colorTextPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/welcome_description"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colortogglePrimary"
android:onClick="dismissWelcome"
android:padding="@dimen/activity_horizontal_margin"
android:textColor="@color/colorTextPrimary"
android:textAllCaps="false"
android:textSize="@dimen/text_size_xlarge"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:text="@string/welcome_button"/>
</LinearLayout>

Просмотреть файл

@ -8,6 +8,7 @@
<dimen name="text_size_medium">14sp</dimen>
<dimen name="text_size_large">18sp</dimen>
<dimen name="text_size_xlarge">20sp</dimen>
<dimen name="text_size_xxlarge">50sp</dimen>
<dimen name="text_size_diff_large_small">6sp</dimen>
<dimen name="card_elevation">2dp</dimen>

Просмотреть файл

@ -50,4 +50,8 @@
<string name="app_name_actions">Jisort - View Settings</string>
<string name="app_name_tutorials">Jisort - View Tutorial</string>
<string name="enable_funmode_description">Enable FUN MODE</string>
<string name="welcome_surtitle">Welcome to</string>
<string name="welcome_title">Jisort!</string>
<string name="welcome_description">Explore the topics in this app to learn more about your phone.</string>
<string name="welcome_button">Ok\! Let\'s go\!</string>
</resources>