mirror of
https://github.com/Aviortheking/Hangman.git
synced 2024-12-19 18:20:54 +00:00
Updating time
This commit is contained in:
parent
c404977f32
commit
0ae21f293f
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@ -2,8 +2,8 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/Hangman-game.iml" filepath="$PROJECT_DIR$/Hangman-game.iml" />
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/hangman-game.iml" filepath="$PROJECT_DIR$/hangman-game.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -2,18 +2,21 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="net.DeltaWings.Android.Hangman">
|
package="net.DeltaWings.Android.Hangman">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:fullBackupContent="@xml/backup_descriptor"
|
android:fullBackupContent="@xml/backup_descriptor"
|
||||||
android:icon="@mipmap/logo"
|
android:icon="@mipmap/logo"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/logo_round"
|
android:roundIcon="@mipmap/logo_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="false"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/DeltaWings.Color">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/DeltaWings">
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/DeltaWings.Color">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
@ -22,15 +25,18 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".GameActivity"
|
android:name=".GameActivity"
|
||||||
android:theme="@style/DeltaWings"
|
android:theme="@style/DeltaWings.Color"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="stateHidden|adjustPan">
|
android:windowSoftInputMode="stateHidden|adjustPan">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".SettingsActivity"
|
android:name=".settings.SettingActivity"
|
||||||
android:label="@string/title_activity_settings">
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/DeltaWings.Dark">
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".AboutActivity"
|
<activity android:name=".AboutActivity"
|
||||||
android:theme="@style/DeltaWings">
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/DeltaWings.Color">
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@ -1,13 +1,38 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
package net.DeltaWings.Android.Hangman;
|
||||||
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class AboutActivity extends AppCompatActivity {
|
public class AboutActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
MainActivity.setTheme(this);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
|
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setDisplayShowHomeEnabled(true);
|
||||||
|
} else {
|
||||||
|
Toast.makeText(MainActivity.getInstance(), "A problem occurred Please restart the application", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp(){
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,109 +0,0 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
|
||||||
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceActivity;
|
|
||||||
import android.support.annotation.LayoutRes;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.app.AppCompatDelegate;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
|
|
||||||
* to be used with AppCompat.
|
|
||||||
*/
|
|
||||||
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
|
|
||||||
|
|
||||||
private AppCompatDelegate mDelegate;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
getDelegate().installViewFactory();
|
|
||||||
getDelegate().onCreate(savedInstanceState);
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
|
||||||
super.onPostCreate(savedInstanceState);
|
|
||||||
getDelegate().onPostCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionBar getSupportActionBar() {
|
|
||||||
return getDelegate().getSupportActionBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSupportActionBar(@Nullable Toolbar toolbar) {
|
|
||||||
getDelegate().setSupportActionBar(toolbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MenuInflater getMenuInflater() {
|
|
||||||
return getDelegate().getMenuInflater();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setContentView(@LayoutRes int layoutResID) {
|
|
||||||
getDelegate().setContentView(layoutResID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setContentView(View view) {
|
|
||||||
getDelegate().setContentView(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
|
||||||
getDelegate().setContentView(view, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
|
||||||
getDelegate().addContentView(view, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostResume() {
|
|
||||||
super.onPostResume();
|
|
||||||
getDelegate().onPostResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onTitleChanged(CharSequence title, int color) {
|
|
||||||
super.onTitleChanged(title, color);
|
|
||||||
getDelegate().setTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
|
||||||
super.onConfigurationChanged(newConfig);
|
|
||||||
getDelegate().onConfigurationChanged(newConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onStop() {
|
|
||||||
super.onStop();
|
|
||||||
getDelegate().onStop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
getDelegate().onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void invalidateOptionsMenu() {
|
|
||||||
getDelegate().invalidateOptionsMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
private AppCompatDelegate getDelegate() {
|
|
||||||
if (mDelegate == null) {
|
|
||||||
mDelegate = AppCompatDelegate.create(this, null);
|
|
||||||
}
|
|
||||||
return mDelegate;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
package net.DeltaWings.Android.Hangman;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
@ -39,6 +38,7 @@ public class GameActivity extends AppCompatActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
MainActivity.setTheme(this);
|
||||||
setContentView(R.layout.game_activity);
|
setContentView(R.layout.game_activity);
|
||||||
|
|
||||||
ProgressBar progressBar = findViewById(R.id.progressBar);
|
ProgressBar progressBar = findViewById(R.id.progressBar);
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
package net.DeltaWings.Android.Hangman;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@ -9,6 +13,8 @@ import android.view.MenuItem;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.DeltaWings.Android.Hangman.settings.SettingActivity;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
public static MainActivity instance;
|
public static MainActivity instance;
|
||||||
@ -17,12 +23,29 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
public boolean single = true;
|
public boolean single = true;
|
||||||
|
public static boolean themeChanged = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if(themeChanged) {
|
||||||
|
themeChanged = false;
|
||||||
|
Intent intent = getIntent();
|
||||||
|
overridePendingTransition(0, 0);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
overridePendingTransition(0, 0);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setTheme(this);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +61,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
findViewById(R.id.singleplayerButton).setOnClickListener(new View.OnClickListener() {
|
findViewById(R.id.singleplayerButton).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Toast.makeText(instance, "WIP", Toast.LENGTH_LONG).show();
|
Toast.makeText(instance, getPref("setting_theme", getApplicationContext()), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -56,14 +79,33 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.navigation_options:
|
case R.id.navigation_options:
|
||||||
// EITHER CALL THE METHOD HERE OR DO THE FUNCTION DIRECTLY
|
startActivity(new Intent(instance, SettingActivity.class));
|
||||||
startActivity(new Intent(instance, SettingsActivity.class));
|
|
||||||
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.navigation_about:
|
||||||
|
startActivity(new Intent(instance, AboutActivity.class));
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void putPref(String key, String value, Context context) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.putString(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPref(String key, Context context) {
|
||||||
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
return preferences.getString(key, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setTheme(Activity activity) {
|
||||||
|
activity.setTheme(activity.getResources().getIdentifier("DeltaWings."+getPref("setting_theme", activity.getApplicationContext()), "style", activity.getPackageName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,254 +0,0 @@
|
|||||||
package net.DeltaWings.Android.Hangman;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.media.Ringtone;
|
|
||||||
import android.media.RingtoneManager;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceActivity;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.preference.PreferenceFragment;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.preference.RingtonePreference;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A {@link PreferenceActivity} that presents a set of application settings. On
|
|
||||||
* handset devices, settings are presented as a single list. On tablets,
|
|
||||||
* settings are split by category, with category headers shown to the left of
|
|
||||||
* the list of settings.
|
|
||||||
* <p>
|
|
||||||
* See <a href="http://developer.android.com/design/patterns/settings.html">
|
|
||||||
* Android Design: Settings</a> for design guidelines and the <a
|
|
||||||
* href="http://developer.android.com/guide/topics/ui/settings.html">Settings
|
|
||||||
* API Guide</a> for more information on developing a Settings UI.
|
|
||||||
*/
|
|
||||||
public class SettingsActivity extends AppCompatPreferenceActivity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A preference value change listener that updates the preference's summary
|
|
||||||
* to reflect its new value.
|
|
||||||
*/
|
|
||||||
private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
|
||||||
String stringValue = value.toString();
|
|
||||||
|
|
||||||
if (preference instanceof ListPreference) {
|
|
||||||
// For list preferences, look up the correct display value in
|
|
||||||
// the preference's 'entries' list.
|
|
||||||
ListPreference listPreference = (ListPreference) preference;
|
|
||||||
int index = listPreference.findIndexOfValue(stringValue);
|
|
||||||
|
|
||||||
// Set the summary to reflect the new value.
|
|
||||||
preference.setSummary(
|
|
||||||
index >= 0
|
|
||||||
? listPreference.getEntries()[index]
|
|
||||||
: null);
|
|
||||||
|
|
||||||
} else if (preference instanceof RingtonePreference) {
|
|
||||||
// For ringtone preferences, look up the correct display value
|
|
||||||
// using RingtoneManager.
|
|
||||||
if (TextUtils.isEmpty(stringValue)) {
|
|
||||||
// Empty values correspond to 'silent' (no ringtone).
|
|
||||||
preference.setSummary(R.string.pref_ringtone_silent);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Ringtone ringtone = RingtoneManager.getRingtone(
|
|
||||||
preference.getContext(), Uri.parse(stringValue));
|
|
||||||
|
|
||||||
if (ringtone == null) {
|
|
||||||
// Clear the summary if there was a lookup error.
|
|
||||||
preference.setSummary(null);
|
|
||||||
} else {
|
|
||||||
// Set the summary to reflect the new ringtone display
|
|
||||||
// name.
|
|
||||||
String name = ringtone.getTitle(preference.getContext());
|
|
||||||
preference.setSummary(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// For all other preferences, set the summary to the value's
|
|
||||||
// simple string representation.
|
|
||||||
preference.setSummary(stringValue);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper method to determine if the device has an extra-large screen. For
|
|
||||||
* example, 10" tablets are extra-large.
|
|
||||||
*/
|
|
||||||
private static boolean isXLargeTablet(Context context) {
|
|
||||||
return (context.getResources().getConfiguration().screenLayout
|
|
||||||
& Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Binds a preference's summary to its value. More specifically, when the
|
|
||||||
* preference's value is changed, its summary (line of text below the
|
|
||||||
* preference title) is updated to reflect the value. The summary is also
|
|
||||||
* immediately updated upon calling this method. The exact display format is
|
|
||||||
* dependent on the type of preference.
|
|
||||||
*
|
|
||||||
* @see #sBindPreferenceSummaryToValueListener
|
|
||||||
*/
|
|
||||||
private static void bindPreferenceSummaryToValue(Preference preference) {
|
|
||||||
// Set the listener to watch for value changes.
|
|
||||||
preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
|
|
||||||
|
|
||||||
// Trigger the listener immediately with the preference's
|
|
||||||
// current value.
|
|
||||||
sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
|
|
||||||
PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(preference.getContext())
|
|
||||||
.getString(preference.getKey(), ""));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setupActionBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up the {@link android.app.ActionBar}, if the API is available.
|
|
||||||
*/
|
|
||||||
private void setupActionBar() {
|
|
||||||
ActionBar actionBar = getSupportActionBar();
|
|
||||||
if (actionBar != null) {
|
|
||||||
// Show the Up button in the action bar.
|
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean onIsMultiPane() {
|
|
||||||
return isXLargeTablet(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public void onBuildHeaders(List<Header> target) {
|
|
||||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method stops fragment injection in malicious applications.
|
|
||||||
* Make sure to deny any unknown fragments here.
|
|
||||||
*/
|
|
||||||
protected boolean isValidFragment(String fragmentName) {
|
|
||||||
return PreferenceFragment.class.getName().equals(fragmentName)
|
|
||||||
|| GeneralPreferenceFragment.class.getName().equals(fragmentName)
|
|
||||||
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|
|
||||||
|| NotificationPreferenceFragment.class.getName().equals(fragmentName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This fragment shows general preferences only. It is used when the
|
|
||||||
* activity is showing a two-pane settings UI.
|
|
||||||
*/
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public static class GeneralPreferenceFragment extends PreferenceFragment {
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_general);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
|
||||||
// to their values. When their values change, their summaries are
|
|
||||||
// updated to reflect the new value, per the Android Design
|
|
||||||
// guidelines.
|
|
||||||
bindPreferenceSummaryToValue(findPreference("example_text"));
|
|
||||||
bindPreferenceSummaryToValue(findPreference("example_list"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == android.R.id.home) {
|
|
||||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This fragment shows notification preferences only. It is used when the
|
|
||||||
* activity is showing a two-pane settings UI.
|
|
||||||
*/
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public static class NotificationPreferenceFragment extends PreferenceFragment {
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_notification);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
|
||||||
// to their values. When their values change, their summaries are
|
|
||||||
// updated to reflect the new value, per the Android Design
|
|
||||||
// guidelines.
|
|
||||||
bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == android.R.id.home) {
|
|
||||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This fragment shows data and sync preferences only. It is used when the
|
|
||||||
* activity is showing a two-pane settings UI.
|
|
||||||
*/
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
public static class DataSyncPreferenceFragment extends PreferenceFragment {
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
addPreferencesFromResource(R.xml.pref_data_sync);
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
// Bind the summaries of EditText/List/Dialog/Ringtone preferences
|
|
||||||
// to their values. When their values change, their summaries are
|
|
||||||
// updated to reflect the new value, per the Android Design
|
|
||||||
// guidelines.
|
|
||||||
bindPreferenceSummaryToValue(findPreference("sync_frequency"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int id = item.getItemId();
|
|
||||||
if (id == android.R.id.home) {
|
|
||||||
startActivity(new Intent(getActivity(), SettingsActivity.class));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,25 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman.Util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GameUtil {
|
||||||
|
|
||||||
|
private String word = null;
|
||||||
|
private List<String> letters = new ArrayList<>();
|
||||||
|
private List<Object> datas = new ArrayList<>();
|
||||||
|
|
||||||
|
public GameUtil() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean datasReader(List<Object> datas) {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Object> datasSender() {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman.settings;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import net.DeltaWings.Android.Hangman.MainActivity;
|
||||||
|
import net.DeltaWings.Android.Hangman.R;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SettingActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
public static boolean themeChanged = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if(themeChanged) {
|
||||||
|
themeChanged = false;
|
||||||
|
Intent intent = getIntent();
|
||||||
|
overridePendingTransition(0, 0);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||||
|
finish();
|
||||||
|
|
||||||
|
overridePendingTransition(0, 0);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
MainActivity.setTheme(this);
|
||||||
|
|
||||||
|
LinearLayout root = (LinearLayout)findViewById(android.R.id.list).getParent().getParent().getParent();
|
||||||
|
Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.preferences_toolbar, root, false);
|
||||||
|
root.addView(bar, 0); // insert at top
|
||||||
|
bar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
MainActivity.setTheme(MainActivity.getInstance());
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValidFragment(String str) {
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBuildHeaders(List<Header> target) {
|
||||||
|
MainActivity.setTheme(this);
|
||||||
|
loadHeadersFromResource(R.xml.settings_headers, target);
|
||||||
|
//getListView().setBackgroundColor(getResources().getColor(R.attr.per));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
finish();
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman.settings;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceFragment;
|
||||||
|
|
||||||
|
import net.DeltaWings.Android.Hangman.MainActivity;
|
||||||
|
import net.DeltaWings.Android.Hangman.R;
|
||||||
|
|
||||||
|
public class generalOptions extends PreferenceFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
addPreferencesFromResource(R.xml.settings_general);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
MainActivity.themeChanged = true;
|
||||||
|
SettingActivity.themeChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman.settings;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceFragment;
|
||||||
|
|
||||||
|
import net.DeltaWings.Android.Hangman.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by 2baze on 12/02/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class multiOptions extends PreferenceFragment {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
addPreferencesFromResource(R.xml.settings_multiplayer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package net.DeltaWings.Android.Hangman.settings;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceFragment;
|
||||||
|
|
||||||
|
import net.DeltaWings.Android.Hangman.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by 2baze on 12/02/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class singleOptions extends PreferenceFragment {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
addPreferencesFromResource(R.xml.settings_singleplayer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
<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="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<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="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z"/>
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<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="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
|
||||||
</vector>
|
|
@ -1,9 +0,0 @@
|
|||||||
<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="#FF000000"
|
|
||||||
android:pathData="M15.5,14h-0.79l-0.28,-0.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,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.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>
|
|
@ -1,9 +0,0 @@
|
|||||||
<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="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-.25 1.97,-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01.25,-1.97.7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z"/>
|
|
||||||
</vector>
|
|
9
app/src/main/res/drawable/people_black.xml
Normal file
9
app/src/main/res/drawable/people_black.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#000"
|
||||||
|
android:pathData="M16.5,6.5A2,2 0 0,1 18.5,8.5A2,2 0 0,1 16.5,10.5A2,2 0 0,1 14.5,8.5A2,2 0 0,1 16.5,6.5M16.5,12A3.5,3.5 0 0,0 20,8.5A3.5,3.5 0 0,0 16.5,5A3.5,3.5 0 0,0 13,8.5A3.5,3.5 0 0,0 16.5,12M7.5,6.5A2,2 0 0,1 9.5,8.5A2,2 0 0,1 7.5,10.5A2,2 0 0,1 5.5,8.5A2,2 0 0,1 7.5,6.5M7.5,12A3.5,3.5 0 0,0 11,8.5A3.5,3.5 0 0,0 7.5,5A3.5,3.5 0 0,0 4,8.5A3.5,3.5 0 0,0 7.5,12M21.5,17.5H14V16.25C14,15.79 13.8,15.39 13.5,15.03C14.36,14.73 15.44,14.5 16.5,14.5C18.94,14.5 21.5,15.71 21.5,16.25M12.5,17.5H2.5V16.25C2.5,15.71 5.06,14.5 7.5,14.5C9.94,14.5 12.5,15.71 12.5,16.25M16.5,13C15.3,13 13.43,13.34 12,14C10.57,13.33 8.7,13 7.5,13C5.33,13 1,14.08 1,16.25V19H23V16.25C23,14.08 18.67,13 16.5,13Z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/people_white.xml
Normal file
9
app/src/main/res/drawable/people_white.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#fff"
|
||||||
|
android:pathData="M16.5,6.5A2,2 0 0,1 18.5,8.5A2,2 0 0,1 16.5,10.5A2,2 0 0,1 14.5,8.5A2,2 0 0,1 16.5,6.5M16.5,12A3.5,3.5 0 0,0 20,8.5A3.5,3.5 0 0,0 16.5,5A3.5,3.5 0 0,0 13,8.5A3.5,3.5 0 0,0 16.5,12M7.5,6.5A2,2 0 0,1 9.5,8.5A2,2 0 0,1 7.5,10.5A2,2 0 0,1 5.5,8.5A2,2 0 0,1 7.5,6.5M7.5,12A3.5,3.5 0 0,0 11,8.5A3.5,3.5 0 0,0 7.5,5A3.5,3.5 0 0,0 4,8.5A3.5,3.5 0 0,0 7.5,12M21.5,17.5H14V16.25C14,15.79 13.8,15.39 13.5,15.03C14.36,14.73 15.44,14.5 16.5,14.5C18.94,14.5 21.5,15.71 21.5,16.25M12.5,17.5H2.5V16.25C2.5,15.71 5.06,14.5 7.5,14.5C9.94,14.5 12.5,15.71 12.5,16.25M16.5,13C15.3,13 13.43,13.34 12,14C10.57,13.33 8.7,13 7.5,13C5.33,13 1,14.08 1,16.25V19H23V16.25C23,14.08 18.67,13 16.5,13Z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/person_black.xml
Normal file
9
app/src/main/res/drawable/person_black.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#000"
|
||||||
|
android:pathData="M12,13C9.33,13 4,14.33 4,17V20H20V17C20,14.33 14.67,13 12,13M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,14.9C14.97,14.9 18.1,16.36 18.1,17V18.1H5.9V17C5.9,16.36 9,14.9 12,14.9M12,5.9A2.1,2.1 0 0,1 14.1,8A2.1,2.1 0 0,1 12,10.1A2.1,2.1 0 0,1 9.9,8A2.1,2.1 0 0,1 12,5.9Z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/person_white.xml
Normal file
9
app/src/main/res/drawable/person_white.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#fff"
|
||||||
|
android:pathData="M12,13C9.33,13 4,14.33 4,17V20H20V17C20,14.33 14.67,13 12,13M12,4A4,4 0 0,0 8,8A4,4 0 0,0 12,12A4,4 0 0,0 16,8A4,4 0 0,0 12,4M12,14.9C14.97,14.9 18.1,16.36 18.1,17V18.1H5.9V17C5.9,16.36 9,14.9 12,14.9M12,5.9A2.1,2.1 0 0,1 14.1,8A2.1,2.1 0 0,1 12,10.1A2.1,2.1 0 0,1 9.9,8A2.1,2.1 0 0,1 12,5.9Z" />
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/shape_outline.xml
Normal file
9
app/src/main/res/drawable/shape_outline.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path android:fillColor="#fff"
|
||||||
|
android:pathData="M11,13.5V21.5H3V13.5H11M9,15.5H5V19.5H9V15.5M12,2L17.5,11H6.5L12,2M12,5.86L10.08,9H13.92L12,5.86M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13M17.5,15A2.5,2.5 0 0,0 15,17.5A2.5,2.5 0 0,0 17.5,20A2.5,2.5 0 0,0 20,17.5A2.5,2.5 0 0,0 17.5,15Z" />
|
||||||
|
</vector>
|
@ -12,11 +12,9 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_below="@+id/appBarLayout"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_below="@+id/appBarLayout"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.507"
|
app:layout_constraintHorizontal_bias="0.507"
|
||||||
|
11
app/src/main/res/layout/preferences_toolbar.xml
Normal file
11
app/src/main/res/layout/preferences_toolbar.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
android:minHeight="?attr/actionBarSize"
|
||||||
|
app:navigationIcon="?attr/homeAsUpIndicator"
|
||||||
|
app:theme="@style/DeltaWings.Color"
|
||||||
|
app:title="@string/app_name"/>
|
@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/navigation_options"
|
android:id="@+id/navigation_options"
|
||||||
android:icon="@drawable/ic_home_black_24dp"
|
|
||||||
android:title="@string/action_settings"/>
|
android:title="@string/action_settings"/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/navigation_notifications"
|
android:id="@+id/navigation_about"
|
||||||
android:icon="@drawable/ic_notifications_black_24dp"
|
|
||||||
android:title="@string/about"/>
|
android:title="@string/about"/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
|
||||||
<item name="android:navigationBarColor">@android:color/black</item>
|
|
||||||
<item name="android:textColorPrimaryInverse">@android:color/background_light</item>
|
|
||||||
<item name="android:textColorPrimary">@android:color/black</item>
|
|
||||||
<item name="android:textColorSecondary">@android:color/background_dark</item>
|
|
||||||
<item name="android:colorForeground">@android:color/background_light</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
20
app/src/main/res/values/arrays.xml
Normal file
20
app/src/main/res/values/arrays.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Settings
|
||||||
|
-->
|
||||||
|
<string-array name="setting_difficulty">
|
||||||
|
<item name="easy">easy</item>
|
||||||
|
<item name="normal">normal</item>
|
||||||
|
<item name="hard">hard</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="theme">
|
||||||
|
<item name="light">Light</item>
|
||||||
|
<item name="dark">Dark</item>
|
||||||
|
<item name="color">Color</item>
|
||||||
|
</string-array>
|
||||||
|
<!--
|
||||||
|
Settings
|
||||||
|
-->
|
||||||
|
</resources>
|
@ -3,4 +3,12 @@
|
|||||||
<color name="colorPrimary">#062988</color>
|
<color name="colorPrimary">#062988</color>
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
<color name="colorAccent">#111984</color>
|
<color name="colorAccent">#111984</color>
|
||||||
|
<color name="Blue">#2196f3</color>
|
||||||
|
<color name="DarkBlue">#0d47a1</color>
|
||||||
|
<color name="Indigo">#3f51b5</color>
|
||||||
|
<color name="Grey50">#fafafa</color>
|
||||||
|
<color name="Grey900">#212121</color>
|
||||||
|
<color name="White">#ffffff</color>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -9,77 +9,29 @@
|
|||||||
<string name="title_notifications">Notifications</string>
|
<string name="title_notifications">Notifications</string>
|
||||||
<string name="loading">Loading…</string>
|
<string name="loading">Loading…</string>
|
||||||
<string name="about">About</string>
|
<string name="about">About</string>
|
||||||
<string name="title_activity_settings">Settings</string>
|
|
||||||
|
|
||||||
<!-- Strings related to Settings -->
|
|
||||||
|
|
||||||
<!-- Example General settings -->
|
<!--
|
||||||
<string name="pref_header_general">General</string>
|
Settings
|
||||||
|
-->
|
||||||
|
<string name="setting_example">example</string>
|
||||||
|
|
||||||
<string name="pref_title_social_recommendations">Enable social recommendations</string>
|
<string name="setting_general_title">General</string>
|
||||||
<string name="pref_description_social_recommendations">Recommendations for people to contact
|
<string name="setting_general_desc">General Configuration</string>
|
||||||
based on your message history
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<string name="pref_title_display_name">Display name</string>
|
<string name="setting_general_theme">Theme</string>
|
||||||
<string name="pref_default_display_name">John Smith</string>
|
|
||||||
|
|
||||||
<string name="pref_title_add_friends_to_messages">Add friends to messages</string>
|
<string name="setting_single_title">Singleplayer</string>
|
||||||
<string-array name="pref_example_list_titles">
|
<string name="setting_single_desc">Singleplayer Configuration</string>
|
||||||
<item>Always</item>
|
|
||||||
<item>When possible</item>
|
|
||||||
<item>Never</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="pref_example_list_values">
|
|
||||||
<item>1</item>
|
|
||||||
<item>0</item>
|
|
||||||
<item>-1</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<!-- Example settings for Data & Sync -->
|
<string name="setting_single_difficulty">Difficulty</string>
|
||||||
<string name="pref_header_data_sync">Data & sync</string>
|
|
||||||
|
|
||||||
<string name="pref_title_sync_frequency">Sync frequency</string>
|
<string name="setting_multi_title">Multiplayer</string>
|
||||||
<string-array name="pref_sync_frequency_titles">
|
<string name="setting_multi_desc">Multiplayer Configuration</string>
|
||||||
<item>15 minutes</item>
|
|
||||||
<item>30 minutes</item>
|
|
||||||
<item>1 hour</item>
|
|
||||||
<item>3 hours</item>
|
|
||||||
<item>6 hours</item>
|
|
||||||
<item>Never</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="pref_sync_frequency_values">
|
|
||||||
<item>15</item>
|
|
||||||
<item>30</item>
|
|
||||||
<item>60</item>
|
|
||||||
<item>180</item>
|
|
||||||
<item>360</item>
|
|
||||||
<item>-1</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<string-array name="list_preference_entries">
|
<string name="setting_multi_ip">Manually enter IP Address</string>
|
||||||
<item>Entry 1</item>
|
<string name="setting_multi_username">Username</string>
|
||||||
<item>Entry 2</item>
|
<!--
|
||||||
<item>Entry 3</item>
|
Settings
|
||||||
</string-array>
|
-->
|
||||||
|
|
||||||
<string-array name="list_preference_entry_values">
|
|
||||||
<item>1</item>
|
|
||||||
<item>2</item>
|
|
||||||
<item>3</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
<string-array name="multi_select_list_preference_default_value"/>
|
|
||||||
|
|
||||||
<string name="pref_title_system_sync_settings">System sync settings</string>
|
|
||||||
|
|
||||||
<!-- Example settings for Notifications -->
|
|
||||||
<string name="pref_header_notifications">Notifications</string>
|
|
||||||
|
|
||||||
<string name="pref_title_new_message_notifications">New message notifications</string>
|
|
||||||
|
|
||||||
<string name="pref_title_ringtone">Ringtone</string>
|
|
||||||
<string name="pref_ringtone_silent">Silent</string>
|
|
||||||
|
|
||||||
<string name="pref_title_vibrate">Vibrate</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,13 +1,33 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<style name="DeltaWings.Dark" parent="Theme.AppCompat">
|
||||||
|
<item name="drawable_people">@drawable/people_white</item>
|
||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
<item name="drawable_person">@drawable/person_white</item>
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
|
|
||||||
|
|
||||||
<style name="DeltaWings" parent="Theme.AppCompat">
|
|
||||||
<item name="colorPrimary">@color/colorAccent</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="DeltaWings.Light" parent="Theme.AppCompat.Light">
|
||||||
|
<item name="drawable_people">@drawable/people_black</item>
|
||||||
|
<item name="drawable_person">@drawable/person_black</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="DeltaWings.Color" parent="Theme.AppCompat.Light">
|
||||||
|
<item name="drawable_people">@drawable/people_black</item>
|
||||||
|
<item name="drawable_person">@drawable/person_black</item>
|
||||||
|
<item name="colorPrimary">@color/Blue</item>
|
||||||
|
<item name="android:textColorPrimary">@color/Grey900</item>
|
||||||
|
<item name="colorPrimaryDark">@color/DarkBlue</item>
|
||||||
|
<item name="colorAccent">@color/Indigo</item>
|
||||||
|
<item name="android:colorBackground">@color/Grey50</item>
|
||||||
|
<item name="android:colorForeground">@color/Grey900</item>
|
||||||
|
<item name="android:textColorPrimaryInverse">@color/White</item>
|
||||||
|
<item name="android:textColorSecondary">@color/Grey900</item>
|
||||||
|
<item name="android:textColorSecondaryInverse">@color/White</item>
|
||||||
|
<item name="android:windowBackground">@color/Grey50</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<attr name="drawable_people" format="reference"/>
|
||||||
|
<attr name="drawable_person" format="reference"/>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
|
|
||||||
dismiss it. -->
|
|
||||||
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="180"
|
|
||||||
android:entries="@array/pref_sync_frequency_titles"
|
|
||||||
android:entryValues="@array/pref_sync_frequency_values"
|
|
||||||
android:key="sync_frequency"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_sync_frequency"/>
|
|
||||||
|
|
||||||
<!-- This preference simply launches an intent when selected. Use this UI sparingly, per
|
|
||||||
design guidelines. -->
|
|
||||||
<Preference android:title="@string/pref_title_system_sync_settings">
|
|
||||||
<intent android:action="android.settings.SYNC_SETTINGS"/>
|
|
||||||
</Preference>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
@ -1,33 +0,0 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="example_switch"
|
|
||||||
android:summary="@string/pref_description_social_recommendations"
|
|
||||||
android:title="@string/pref_title_social_recommendations"/>
|
|
||||||
|
|
||||||
<!-- NOTE: EditTextPreference accepts EditText attributes. -->
|
|
||||||
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
|
|
||||||
<EditTextPreference
|
|
||||||
android:capitalize="words"
|
|
||||||
android:defaultValue="@string/pref_default_display_name"
|
|
||||||
android:inputType="textCapWords"
|
|
||||||
android:key="example_text"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:selectAllOnFocus="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:title="@string/pref_title_display_name"/>
|
|
||||||
|
|
||||||
<!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
|
|
||||||
dismiss it. -->
|
|
||||||
<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="-1"
|
|
||||||
android:entries="@array/pref_example_list_titles"
|
|
||||||
android:entryValues="@array/pref_example_list_values"
|
|
||||||
android:key="example_list"
|
|
||||||
android:negativeButtonText="@null"
|
|
||||||
android:positiveButtonText="@null"
|
|
||||||
android:title="@string/pref_title_add_friends_to_messages"/>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
@ -1,20 +0,0 @@
|
|||||||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- These settings headers are only used on tablets. -->
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="net.DeltaWings.Android.Hangman.SettingsActivity$GeneralPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_info_black_24dp"
|
|
||||||
android:title="@string/pref_header_general"/>
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="net.DeltaWings.Android.Hangman.SettingsActivity$NotificationPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_notifications_black_24dp"
|
|
||||||
android:title="@string/pref_header_notifications"/>
|
|
||||||
|
|
||||||
<header
|
|
||||||
android:fragment="net.DeltaWings.Android.Hangman.SettingsActivity$DataSyncPreferenceFragment"
|
|
||||||
android:icon="@drawable/ic_sync_black_24dp"
|
|
||||||
android:title="@string/pref_header_data_sync"/>
|
|
||||||
|
|
||||||
</preference-headers>
|
|
@ -1,27 +0,0 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<!-- A 'parent' preference, which enables/disables child preferences (below)
|
|
||||||
when checked/unchecked. -->
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="notifications_new_message"
|
|
||||||
android:title="@string/pref_title_new_message_notifications"/>
|
|
||||||
|
|
||||||
<!-- Allows the user to choose a ringtone in the 'notification' category. -->
|
|
||||||
<!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
|
|
||||||
<!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
|
|
||||||
<RingtonePreference
|
|
||||||
android:defaultValue="content://settings/system/notification_sound"
|
|
||||||
android:dependency="notifications_new_message"
|
|
||||||
android:key="notifications_new_message_ringtone"
|
|
||||||
android:ringtoneType="notification"
|
|
||||||
android:title="@string/pref_title_ringtone"/>
|
|
||||||
|
|
||||||
<!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
|
|
||||||
<SwitchPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:dependency="notifications_new_message"
|
|
||||||
android:key="notifications_new_message_vibrate"
|
|
||||||
android:title="@string/pref_title_vibrate"/>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
9
app/src/main/res/xml/settings_general.xml
Normal file
9
app/src/main/res/xml/settings_general.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="Color"
|
||||||
|
android:entries="@array/theme"
|
||||||
|
android:entryValues="@array/theme"
|
||||||
|
android:key="setting_theme"
|
||||||
|
android:title="@string/setting_general_theme"/>
|
||||||
|
</PreferenceScreen>
|
18
app/src/main/res/xml/settings_headers.xml
Normal file
18
app/src/main/res/xml/settings_headers.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<header android:fragment="net.DeltaWings.Android.Hangman.settings.generalOptions"
|
||||||
|
android:icon="@drawable/shape_outline"
|
||||||
|
android:title="@string/setting_general_title"
|
||||||
|
android:summary="@string/setting_general_desc" />
|
||||||
|
|
||||||
|
<header android:fragment="net.DeltaWings.Android.Hangman.settings.singleOptions"
|
||||||
|
android:icon="?attr/drawable_person"
|
||||||
|
android:title="@string/setting_single_title"
|
||||||
|
android:summary="@string/setting_single_desc" />
|
||||||
|
|
||||||
|
<header android:fragment="net.DeltaWings.Android.Hangman.settings.multiOptions"
|
||||||
|
android:icon="?attr/drawable_people"
|
||||||
|
android:title="@string/setting_multi_title"
|
||||||
|
android:summary="@string/setting_multi_desc" />
|
||||||
|
|
||||||
|
</preference-headers>
|
15
app/src/main/res/xml/settings_multiplayer.xml
Normal file
15
app/src/main/res/xml/settings_multiplayer.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="127.0.0.1"
|
||||||
|
android:key="setting_ipaddress"
|
||||||
|
android:selectAllOnFocus="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:title="@string/setting_multi_ip"/>
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="Aviortheking"
|
||||||
|
android:key="setting_username"
|
||||||
|
android:selectAllOnFocus="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:title="@string/setting_multi_username"/>
|
||||||
|
</PreferenceScreen>
|
9
app/src/main/res/xml/settings_singleplayer.xml
Normal file
9
app/src/main/res/xml/settings_singleplayer.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="1"
|
||||||
|
android:entries="@array/setting_difficulty"
|
||||||
|
android:entryValues="@array/setting_difficulty"
|
||||||
|
android:key="setting_difficulty"
|
||||||
|
android:title="@string/setting_single_difficulty"/>
|
||||||
|
</PreferenceScreen>
|
Loading…
x
Reference in New Issue
Block a user