forked from marsavela/WWTBAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Añadidas las preferencias y tambien los creditos.
- Loading branch information
Showing
14 changed files
with
244 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package es.serpat.wwtbam; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
|
||
/** | ||
* Created by SergiuDaniel on 10/10/13. | ||
*/ | ||
public class Credits extends Activity{ | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.credits); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,67 @@ | ||
package es.serpat.wwtbam; | ||
|
||
import android.os.Bundle; | ||
import android.app.Activity; | ||
import android.view.Menu; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class MainActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Button bPlay = (Button) findViewById(R.id.butPlay); | ||
bPlay.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
launchGame(null); | ||
} | ||
}); | ||
Button bPreferences = (Button) findViewById(R.id.butSettings); | ||
bPreferences.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
launchPreferences(null); | ||
} | ||
}); | ||
Button bScores = (Button) findViewById(R.id.butScores); | ||
bScores.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
launchScores(null); | ||
} | ||
}); | ||
Button bAbout = (Button) findViewById(R.id.butAbout); | ||
bAbout.setOnClickListener(new View.OnClickListener() { | ||
|
||
@Override | ||
public void onClick(View view) { | ||
launchAbout(null); | ||
} | ||
}); | ||
} | ||
|
||
private void launchScores(View view) { | ||
//Intent i = new Intent(this, Scores.class); | ||
//startActivity(i); | ||
} | ||
|
||
private void launchGame(View view) { | ||
//Intent i = new Intent(this, Game.class); | ||
//startActivity(i); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.main, menu); | ||
return true; | ||
private void launchPreferences(View view) { | ||
Intent i = new Intent(this, SetPreferences.class); | ||
startActivity(i); | ||
} | ||
|
||
public void launchAbout(View view) { | ||
Intent i = new Intent(this, Credits.class); | ||
startActivity(i); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package es.serpat.wwtbam; | ||
|
||
import android.os.Bundle; | ||
import android.preference.PreferenceFragment; | ||
|
||
/** | ||
* Created by SergiuDaniel on 10/10/13. | ||
*/ | ||
public class Preferences extends PreferenceFragment { | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
addPreferencesFromResource(R.xml.preferences); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package es.serpat.wwtbam; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
|
||
/** | ||
* Created by SergiuDaniel on 2/07/13. | ||
*/ | ||
public class SetPreferences extends Activity{ | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
// TODO Auto-generated method stub | ||
super.onCreate(savedInstanceState); | ||
|
||
getFragmentManager().beginTransaction().replace(android.R.id.content, | ||
new Preferences()).commit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingLeft="@dimen/activity_horizontal_margin" | ||
android:paddingRight="@dimen/activity_horizontal_margin" | ||
android:paddingTop="@dimen/activity_vertical_margin" | ||
android:paddingBottom="@dimen/activity_vertical_margin" | ||
tools:context=".MainActivity"> | ||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:padding="30dp" | ||
android:gravity="center"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/hello_world" /> | ||
android:text="@string/app_name" | ||
android:id="@+id/titleWWTBAM" | ||
style="@style/textWWTBAM"/> | ||
|
||
</RelativeLayout> | ||
<Button | ||
android:text="@string/play" | ||
android:id="@+id/butPlay" | ||
style="@style/button"/> | ||
|
||
<Button | ||
android:text="@string/settings" | ||
android:id="@+id/butSettings" | ||
style="@style/button"/> | ||
|
||
<Button | ||
android:text="@string/scores" | ||
android:id="@+id/butScores" | ||
style="@style/button"/> | ||
|
||
<Button | ||
android:text="@string/about" | ||
android:id="@+id/butAbout" | ||
style="@style/button"/> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/about_text" | ||
android:textSize="18sp" | ||
android:layout_margin="30dp"/> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string-array name="numHelps"> | ||
<item>0</item> | ||
<item>1</item> | ||
<item>2</item> | ||
<item>3</item> | ||
</string-array> | ||
<string-array name="numHelpsValues"> | ||
<item>0</item> | ||
<item>1</item> | ||
<item>2</item> | ||
<item>3</item> | ||
</string-array> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<EditTextPreference | ||
android:key="fragments" | ||
android:title="@string/pref_name_title" | ||
android:summary="@string/pref_name_summary"/> | ||
<ListPreference | ||
android:key="graphics" | ||
android:title="@string/pref_title_help" | ||
android:summary="@string/pref_help_summary" | ||
android:entries="@array/numHelps" | ||
android:entryValues="@array/numHelpsValues" | ||
android:defaultValue="3"/> | ||
<EditTextPreference | ||
android:key="fragments" | ||
android:title="@string/pref_addFriend_title" | ||
android:summary="@string/pref_addFriend_summary"/> | ||
</PreferenceScreen> |