fix #32
This commit is contained in:
Jennifer Muenk 2018-01-25 00:45:44 +01:00
parent bf9d5f595b
commit a4f2fb7a5c
24 changed files with 900 additions and 20 deletions

View File

@ -24,7 +24,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -2,7 +2,6 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/WifiP2P.iml" filepath="$PROJECT_DIR$/WifiP2P.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/flashwifi.iml" filepath="$PROJECT_DIR$/flashwifi.iml" />
</modules>

View File

@ -15,11 +15,12 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission-sdk-23 android:name="android.permission.WRITE_SETTINGS" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions"/>
tools:ignore="ProtectedPermissions" />
<application
android:allowBackup="true"
@ -28,14 +29,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">
<activity android:name=".HomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity"></activity>
<activity
android:name=".RoamingActivity"
android:parentActivityName=".MainActivity" />
@ -44,9 +38,17 @@
android:name=".broadcast.WiFiDirectBroadcastService"
android:description="@string/wifi_direct" />
<activity android:name=".MainActivity"
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,41 @@
package com.flashwifi.wifip2p;
/**
* Created by Jenny on 23.01.2018.
*/
import android.content.Context;
import android.content.SharedPreferences;
/**
* Created by Lincoln on 05/05/16.
*/
public class PrefManager {
SharedPreferences pref;
SharedPreferences.Editor editor;
Context _context;
// shared pref mode
int PRIVATE_MODE = 0;
// Shared preferences file name
private static final String PREF_NAME = "androidhive-welcome";
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
public PrefManager(Context context) {
this._context = context;
pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
editor = pref.edit();
}
public void setFirstTimeLaunch(boolean isFirstTime) {
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
editor.commit();
}
public boolean isFirstTimeLaunch() {
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
}
}

View File

@ -0,0 +1,425 @@
package com.flashwifi.wifip2p;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.AppOpsManager;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.provider.Settings;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.text.Editable;
import android.text.Html;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.pddstudio.preferences.encrypted.EncryptedPreferences;
import jota.utils.SeedRandomGenerator;
public class WelcomeActivity extends AppCompatActivity {
private ViewPager viewPager;
private MyViewPagerAdapter myViewPagerAdapter;
private LinearLayout dotsLayout;
private TextView[] dots;
private int[] layouts;
private Button btnNext;
private EditText passwordInput;
private PrefManager prefManager;
private TextView seedView;
private String seed, password;
@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Checking for first time launch - before calling setContentView()
prefManager = new PrefManager(this);
// Making notification bar transparent
if (Build.VERSION.SDK_INT >= 21) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
setContentView(R.layout.activity_welcome);
viewPager = (ViewPager) findViewById(R.id.view_pager);
dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
btnNext = (Button) findViewById(R.id.btn_next);
if (hasSeed()) {
layouts = new int[]{
R.layout.login_screen,
R.layout.welcome_screen3
};
btnNext.setVisibility(View.GONE);
btnNext.setText("LOGIN");
} else {
layouts = new int[]{
R.layout.welcome_screen1,
R.layout.welcome_screen2,
R.layout.welcome_screen3,
R.layout.welcome_screen4,
R.layout.welcome_screen5,
R.layout.welcome_screen6
};
}
// adding bottom dots
addBottomDots(0);
// making notification bar transparent
changeStatusBarColor();
myViewPagerAdapter = new MyViewPagerAdapter();
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
viewPager.beginFakeDrag();
boolean firstTimeNoSeed = hasSeed();
btnNext.setOnClickListener(v -> {
// checking for last page
// if last page home screen will be launched
int current = getItem(+1);
if(firstTimeNoSeed && current == 2 && !btnNext.getText().equals("DONE")) {
requestPermissions();
} else if (firstTimeNoSeed && current == 1) {
EditText pw = (EditText) findViewById(R.id.password);
String pass = pw.getText().toString();
if(decryptSeed(pass)) {
viewPager.setCurrentItem(current);
}
} else if(current == 3 && !btnNext.getText().equals("DONE")) {
requestPermissions();
} else if (current < layouts.length) {
// move to next screen
viewPager.setCurrentItem(current);
} else if(!firstTimeNoSeed) {
launchHomeScreen();
} else {
startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
}
});
}
private void addBottomDots(int currentPage) {
dots = new TextView[layouts.length];
int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);
int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i].setText(Html.fromHtml("&#8226;"));
dots[i].setTextSize(35);
dots[i].setTextColor(colorsInactive[currentPage]);
dotsLayout.addView(dots[i]);
}
if (dots.length > 0)
dots[currentPage].setTextColor(colorsActive[currentPage]);
}
private int getItem(int i) {
return viewPager.getCurrentItem() + i;
}
private void launchHomeScreen() {
prefManager.setFirstTimeLaunch(false);
storeNewSeed();
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra("seed", seed);
intent.putExtra("password", password);
startActivity(intent);
finish();
}
// viewpager change listener
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int position) {
addBottomDots(position);
Log.e("########", "onPageSelected: " + position);
// changing the next button text 'NEXT' / 'GOT IT'
if(hasSeed()) {
if (position == 1) {
// Screen3 -> Ask for Permissions
btnNext.setText("OK");
}
} else {
if (position == layouts.length - 1) {
// last page. make button text to GOT IT
btnNext.setText(getString(R.string.start));
} else if (position == 2) {
// Screen3 -> Ask for Permissions
btnNext.setText("OK");
} else if(position == 3) {
//Screen4 -> Generate Seed
btnNext.setText(getString(R.string.generateSeed));
seed = SeedRandomGenerator.generateNewSeed();
} else if(position == 4) {
//Screen5 -> Save Password
btnNext.setText(getString(R.string.save));
btnNext.setVisibility(View.GONE);
seedView = (TextView) findViewById(R.id.seed_view);
seedView.setText(seed);
passwordInput = (EditText) findViewById(R.id.password);
passwordInput.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if(editable.length() != 0) {
btnNext.setVisibility(View.VISIBLE);
} else {
btnNext.setVisibility(View.GONE);
}
password = passwordInput.getText().toString();
}
});
} else {
// still pages are left
btnNext.setText(getString(R.string.next));
}
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
};
/**
* Making notification bar transparent
*/
private void changeStatusBarColor() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
}
/**
* Request Permissions
*/
private void requestPermissions() {
ActivityCompat.requestPermissions(this,
new String[]{
Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.CHANGE_WIFI_STATE,
Manifest.permission.CHANGE_NETWORK_STATE,
Manifest.permission.INTERNET,
Manifest.permission.ACCESS_NETWORK_STATE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.CAMERA
},
1);
}
private void storeNewSeed() {
// store the seed encrypted
EncryptedPreferences encryptedPreferences = new EncryptedPreferences.Builder(this).withEncryptionPassword(password).build();
encryptedPreferences.edit()
.putString(getString(R.string.encrypted_seed), seed)
.apply();
// store the status in plain mode
SharedPreferences sharedPref = this.getSharedPreferences(
getString(R.string.preference_file_key), Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean(getString(R.string.active_seed), true);
editor.apply();
}
private boolean hasSeed() {
SharedPreferences sharedPref = this.getSharedPreferences(
getString(R.string.preference_file_key), Context.MODE_PRIVATE);
return sharedPref.getBoolean(getString(R.string.active_seed), false);
}
private boolean decryptSeed(String password) {
EncryptedPreferences encryptedPreferences = new EncryptedPreferences.Builder(this).withEncryptionPassword(password).build();
String seed = encryptedPreferences.getString(getString(R.string.encrypted_seed), null);
View view = findViewById(R.id.home_view);
if (seed != null) {
//Snackbar.make(view, getString(R.string.seed_decrypted), Snackbar.LENGTH_LONG).setAction("Action", null).show();
return true;
} else {
final EditText field = (EditText) findViewById(R.id.password);
field.setText("");
Toast toast= Toast.makeText(getApplicationContext(),
getString(R.string.wrong_password), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP|Gravity.CENTER_HORIZONTAL, 0, 0);
toast.show();
return false;
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
case 1: {
// If request is cancelled, the result arrays are empty.
int i = 0;
if (grantResults.length > 0) {
boolean ok = true;
for (int grantResult: grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) {
ok = false;
Log.d("Permissions", "onRequestPermissionsResult: denied: " + permissions[i]);
}
i++;
}
AppOpsManager appOps = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE);
int mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,
android.os.Process.myUid(), getPackageName());
if (mode != AppOpsManager.MODE_ALLOWED) {
ok = false;
Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
startActivity(intent);
}
int mode2 = appOps.checkOpNoThrow(AppOpsManager.OPSTR_WRITE_SETTINGS,
android.os.Process.myUid(), getPackageName());
if (mode2 != AppOpsManager.MODE_ALLOWED) {
ok = false;
Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
startActivity(intent);
}
if (ok) {
Toast.makeText(WelcomeActivity.this, "Permissions granted", Toast.LENGTH_SHORT).show();
btnNext.setText("DONE");
} else {
Toast.makeText(WelcomeActivity.this, "Permissions denied", Toast.LENGTH_SHORT).show();
btnNext.setText("OK");
}
} else {
// permission denied, boo! Disable the
// functionality that depends on this permission.
Toast.makeText(WelcomeActivity.this, "Permission denied to read your External storage", Toast.LENGTH_SHORT).show();
}
}
// other 'case' lines to check for other
// permissions this app might request
}
}
/**
* View pager adapter
*/
public class MyViewPagerAdapter extends PagerAdapter {
private LayoutInflater layoutInflater;
public MyViewPagerAdapter() {
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = layoutInflater.inflate(layouts[position], container, false);
container.addView(view);
if(hasSeed() && position == 0) {
EditText pw = (EditText) findViewById(R.id.password);
pw.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
Log.d("####", "onTextChanged: ");
}
@Override
public void afterTextChanged(Editable editable) {
if( pw.getText().toString().length() != 0) {
btnNext.setVisibility(View.VISIBLE);
}
}
});
}
return view;
}
@Override
public int getCount() {
return layouts.length;
}
@Override
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
View view = (View) object;
container.removeView(view);
}
}
}

View File

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12 3C6.95 3 3.15 4.85 0 7.23L12 22 24 7.25C20.85 4.87 17.05 3 12 3zm1 13h-2v-6h2v6zm-2-8V6h2v2h-2z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,4 +1,10 @@
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
</vector>

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 508 B

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12 11c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 2c0-3.31-2.69-6-6-6s-6 2.69-6 6c0 2.22 1.21 4.15 3 5.19l1-1.74c-1.19-.7-2-1.97-2-3.45 0-2.21 1.79-4 4-4s4 1.79 4 4c0 1.48-.81 2.75-2 3.45l1 1.74c1.79-1.04 3-2.97 3-5.19zM12 3C6.48 3 2 7.48 2 13c0 3.7 2.01 6.92 4.99 8.65l1-1.73C5.61 18.53 4 15.96 4 13c0-4.42 3.58-8 8-8s8 3.58 8 8c0 2.96-1.61 5.53-4 6.92l1 1.73c2.99-1.73 5-4.95 5-8.65 0-5.52-4.48-10-10-10z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -49,10 +49,10 @@
/>
<Button
android:id="@+id/decryptTheSeedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/decryptTheSeed"
android:id="@+id/decryptTheSeedButton"
android:visibility="invisible" />
<Button
@ -66,10 +66,10 @@
android:id="@+id/seedTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:background="#FFFFFF"
android:text=""
android:textColor="#111111"
android:layout_margin="20dp"
android:textSize="20sp"
android:visibility="invisible" />

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="match_parent"
android:layout_height="@dimen/dots_height"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dots_margin_bottom"
android:gravity="center"
android:orientation="horizontal"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:alpha=".5"
android:layout_above="@id/layoutDots"
android:background="@android:color/white" />
<Button
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@null"
android:paddingRight="10dp"
android:text="@string/next"
android:textColor="@android:color/white" />
</RelativeLayout>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="56dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:background="@color/screen1"
android:gravity="center_horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:background="@drawable/ic_app_logo"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginBottom="40dp"
android:layout_marginTop="40dp"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your Password to continue:"
android:textColor="@android:color/white"
android:textSize="20dp"
android:layout_marginTop="50dp"/>
<EditText
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:textAlignment="viewStart"
android:textColor="#ffffff"
android:textColorHint="#b7b7b7"
android:backgroundTint="#898989"/>
</LinearLayout>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/ic_app_logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide_1_title"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_title"
android:textStyle="bold"
android:layout_marginTop="60dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="The blablablablabla App"
android:textColor="@android:color/white"
android:textSize="20dp"
android:layout_marginTop="15dp"/>
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="@drawable/iota"
android:backgroundTint="#ffffff"
android:visibility="visible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_2_desc"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen3">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/ic_pan_tool"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_3_desc"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen4">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/ic_lock_outline"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_4_desc"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen5">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:id="@+id/linearLayout">
<TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#ffffff"
android:id="@+id/seed_view"
android:padding="15dp"
android:textSize="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_5_desc"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" />
<EditText
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:textAlignment="viewStart"
android:textColor="#ffffff"
android:textColorHint="#b7b7b7"
android:backgroundTint="#898989"/>
</LinearLayout>
</RelativeLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen6">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/ic_wifi_tethering"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_6_desc"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>

View File

@ -6,6 +6,48 @@
<color name="black_overlay">#66000000</color>
<color name="colour_highlight_grey">#ff666666</color>
<color name="colour_dark_blue">#ff000066</color>
<color name="colour_dark_blue">#000066</color>
<color name="colour_dark_green">#ff006600</color>
<!-- Welcome Slideshow -->
<color name="screen1">#303F9F</color>
<color name="screen2">#14a895</color>
<color name="screen3">#057dac</color>
<color name="screen4">#0323a6</color>
<color name="screen5">#1e408f</color>
<color name="screen6">#05bef1</color>
<!-- dots inactive colors -->
<color name="dot_dark_screen1">#101433</color>
<color name="dot_dark_screen2">#0c685c</color>
<color name="dot_dark_screen3">#034660</color>
<color name="dot_dark_screen4">#000826</color>
<color name="dot_dark_screen5">#081023</color>
<color name="dot_dark_screen6">#006b89</color>
<!-- dots active colors -->
<color name="dot_light_screen1">#7688f9</color>
<color name="dot_light_screen2">#8cf9eb</color>
<color name="dot_light_screen3">#93c6fd</color>
<color name="dot_light_screen4">#7691ff</color>
<color name="dot_light_screen5">#4073e9</color>
<color name="dot_light_screen6">#adedff</color>
<array name="array_dot_active">
<item>@color/dot_light_screen1</item>
<item>@color/dot_light_screen2</item>
<item>@color/dot_light_screen3</item>
<item>@color/dot_light_screen4</item>
<item>@color/dot_light_screen5</item>
<item>@color/dot_light_screen6</item>
</array>
<array name="array_dot_inactive">
<item>@color/dot_dark_screen1</item>
<item>@color/dot_dark_screen2</item>
<item>@color/dot_dark_screen3</item>
<item>@color/dot_dark_screen4</item>
<item>@color/dot_dark_screen5</item>
<item>@color/dot_dark_screen6</item>
</array>
</resources>

View File

@ -7,4 +7,12 @@
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<!-- Welcome Slideshow -->
<dimen name="dots_height">30dp</dimen>
<dimen name="dots_margin_bottom">20dp</dimen>
<dimen name="img_width_height">120dp</dimen>
<dimen name="slide_title">30dp</dimen>
<dimen name="slide_desc">16dp</dimen>
<dimen name="desc_padding">40dp</dimen>
</resources>

View File

@ -69,4 +69,23 @@
<string name="initRetransfer">Initializing retransfer</string>
<string name="welcome">Welcome to the Wifi Iota Hotspot App</string>
<!-- Welcome Slideshow -->
<!-- Page 1 -->
<string name="next">Next</string>
<string name="start">Start</string>
<string name="save">Save</string>
<string name="dialog_message_pw">Password missing!</string>
<string name="dialog_title_pw">Please enter a password</string>
<string name="slide_1_title">Welcome to Wifiota!</string>
<string name="slide_2_desc">Share remaining megabytes from your data plan and get paid Iota. Or get access to WiFi in foreign countries, airports or coffee shops in exchange for Iota.</string>
<string name="slide_3_desc">In order to discover, communicate and share WiFi with people around you, please give the following permissions.</string>
<string name="slide_4_desc">The app creates a new seed for you which is something like a cryptographic password for your iota balance. You can deposit and withdraw to it. </string>
<string name="slide_5_desc">The app will only store a version of the seed that is encrypted by a password. Please enter a password! </string>
<string name="slide_6_desc">Have fun with Wifiota and please always remember that we are still working on this app.</string>
</resources>