Skip to content

Commit

Permalink
Para testar nos celulares do colégio.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahuanls committed Jun 26, 2013
1 parent b6190d3 commit 4c91c29
Show file tree
Hide file tree
Showing 33 changed files with 178 additions and 90 deletions.
7 changes: 7 additions & 0 deletions LoveGame_Project/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
Binary file modified LoveGame_Project/bin/LoveGame_Project.apk
Binary file not shown.
Binary file modified LoveGame_Project/bin/classes.dex
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified LoveGame_Project/bin/resources.ap_
Binary file not shown.
76 changes: 40 additions & 36 deletions LoveGame_Project/gen/com/example/lovegame_project/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,53 @@ public static final class dimen {
}
public static final class drawable {
public static final int bg=0x7f020000;
public static final int botao_creditos=0x7f020001;
public static final int botao_instrucoes=0x7f020002;
public static final int botao_jogar=0x7f020003;
public static final int botao_scanear=0x7f020004;
public static final int celular_bluetooth=0x7f020005;
public static final int credito=0x7f020006;
public static final int ic_launcher=0x7f020007;
public static final int icone_final_48x48=0x7f020008;
public static final int instrucao=0x7f020009;
public static final int pergunta_tela=0x7f02000a;
public static final int tela_inicio=0x7f02000b;
public static final int botao_certo=0x7f020001;
public static final int botao_creditos=0x7f020002;
public static final int botao_errado=0x7f020003;
public static final int botao_instrucoes=0x7f020004;
public static final int botao_jogar=0x7f020005;
public static final int botao_scanear=0x7f020006;
public static final int celular_bluetooth=0x7f020007;
public static final int credito=0x7f020008;
public static final int ic_launcher=0x7f020009;
public static final int icone_final_48x48=0x7f02000a;
public static final int instrucao=0x7f02000b;
public static final int pergunta_tela=0x7f02000c;
public static final int tela_inicio=0x7f02000d;
}
public static final class id {
public static final int Nao=0x7f090011;
public static final int Pergunta=0x7f09000d;
public static final int Resposta=0x7f09000e;
public static final int ScanButton=0x7f090013;
public static final int Sim=0x7f090010;
public static final int TextView01=0x7f090017;
public static final int Voltar=0x7f09000f;
public static final int action_settings=0x7f09001d;
public static final int activateBtButton=0x7f090012;
public static final int bt_comecar=0x7f09001c;
public static final int bt_creditos=0x7f09001a;
public static final int Nao=0x7f090013;
public static final int Pergunta=0x7f09000f;
public static final int Resposta=0x7f090010;
public static final int ScanButton=0x7f090015;
public static final int Sim=0x7f090012;
public static final int TextView01=0x7f090019;
public static final int Voltar=0x7f090011;
public static final int action_settings=0x7f09001f;
public static final int activateBtButton=0x7f090014;
public static final int botao_certo=0x7f090005;
public static final int botao_errado=0x7f090007;
public static final int bt_comecar=0x7f09001e;
public static final int bt_creditos=0x7f09001c;
public static final int bt_enviar=0x7f090004;
public static final int bt_enviarSalvo=0x7f090015;
public static final int bt_instrucoes=0x7f09001b;
public static final int bt_enviarSalvo=0x7f090017;
public static final int bt_instrucoes=0x7f09001d;
public static final int button1=0x7f090001;
public static final int button_scan=0x7f09000a;
public static final int corpoTxt=0x7f090018;
public static final int edit_resposta=0x7f090005;
public static final int leaveButton=0x7f090014;
public static final int newDevicesTittle=0x7f090008;
public static final int new_devices=0x7f090009;
public static final int nomeTxt=0x7f090016;
public static final int pairedDevicesTittle=0x7f090006;
public static final int paired_devices=0x7f090007;
public static final int button_scan=0x7f09000c;
public static final int corpoTxt=0x7f09001a;
public static final int edit_resposta=0x7f090006;
public static final int leaveButton=0x7f090016;
public static final int newDevicesTittle=0x7f09000a;
public static final int new_devices=0x7f09000b;
public static final int nomeTxt=0x7f090018;
public static final int pairedDevicesTittle=0x7f090008;
public static final int paired_devices=0x7f090009;
public static final int pergunta=0x7f090002;
public static final int resposta=0x7f090003;
public static final int textView1=0x7f090000;
public static final int txtPreencher=0x7f09000c;
public static final int txtRoot2=0x7f09000b;
public static final int voltar=0x7f090019;
public static final int txtPreencher=0x7f09000e;
public static final int txtRoot2=0x7f09000d;
public static final int voltar=0x7f09001b;
}
public static final class layout {
public static final int activity_achievements_menu=0x7f030000;
Expand Down
Binary file added LoveGame_Project/res/drawable-mdpi/botao_certo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added LoveGame_Project/res/drawable-mdpi/botao_errado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion LoveGame_Project/res/layout/activity_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:layout_marginTop="35dp"
android:text="Qual a cor do lápis que você mais gosta, bebê?"
android:text="..."
android:textColor="@android:color/white"
android:textSize="18sp" />

Expand Down Expand Up @@ -42,6 +42,15 @@
android:onClick="onClick_SendButton"
android:text="@string/send_button" />

<ImageButton
android:id="@+id/botao_certo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/edit_resposta"
android:layout_alignTop="@+id/bt_enviar"
android:layout_marginLeft="42dp"
android:background="@drawable/botao_certo" />

<EditText
android:id="@+id/edit_resposta"
android:layout_width="200dp"
Expand All @@ -52,4 +61,13 @@
android:ems="10"
android:inputType="text" />

<ImageButton
android:id="@+id/botao_errado"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true"
android:layout_below="@+id/resposta"
android:layout_marginLeft="230dp"
android:background="@drawable/botao_errado" />

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ public void run() {
} catch (IOException e) {
e.printStackTrace();
}

}
}


public static void Cancel()
{

Expand Down
80 changes: 54 additions & 26 deletions LoveGame_Project/src/com/example/lovegame_project/Chat.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;

public class Chat extends Activity {
Expand All @@ -27,14 +28,19 @@ public class Chat extends Activity {
private EditText edit_resposta;
private TextView textv_pergunta;
private TextView textv_resposta;
private ImageButton botaoErrado;
private ImageButton botaoCerto;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

//Criar classe para mudar orientacao e mexer com full screen etc
// Screen adjustments
// Screen adjustments
// Atenção: É preciso mudar em layout para horizontal, caso contrário serão
// criadas duas activitys. Lembrar caso Toast.

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Expand All @@ -48,13 +54,28 @@ protected void onCreate(Bundle savedInstanceState) {
this.edit_resposta = (EditText)findViewById( R.id.edit_resposta);
this.textv_pergunta = (TextView)findViewById(R.id.pergunta);
this.textv_resposta = (TextView)findViewById(R.id.resposta);
this.botaoCerto = (ImageButton)findViewById(R.id.botao_certo);
this.botaoErrado = (ImageButton)findViewById(R.id.botao_errado);

this.textv_pergunta.setText(PegarPergunta());
}
if(!JogoEmSi.get().getTurn())
{
NovaPergunta();
}

ChangeVisualization(JogoEmSi.get().getTurn());

public void ChangePergunta()
}
public void ChangePergunta(String pergunta)
{
this.textv_pergunta.setText(PegarPergunta());
this.textv_pergunta.setText(pergunta);
}

public void NovaPergunta()
{
String pergunta = PegarPergunta();
String protocol = "Pergunta/";
JogoEmSi.get().Send(protocol + pergunta);
this.textv_pergunta.setText(pergunta);
}
public String PegarPergunta()
{
Expand Down Expand Up @@ -98,7 +119,13 @@ public void ChangeVisualization(boolean turn)
this.edit_resposta.setVisibility(View.VISIBLE);

this.textv_resposta.setVisibility(View.INVISIBLE);


this.botaoCerto.setEnabled(false);
this.botaoCerto.setVisibility(View.INVISIBLE);

this.botaoErrado.setEnabled(false);
this.botaoErrado.setVisibility(View.INVISIBLE);

}else
{
// Turno de corrigir
Expand All @@ -109,9 +136,30 @@ public void ChangeVisualization(boolean turn)
this.edit_resposta.setVisibility(View.INVISIBLE);

this.textv_resposta.setVisibility(View.VISIBLE);

this.botaoCerto.setEnabled(true);
this.botaoCerto.setVisibility(View.VISIBLE);

this.botaoErrado.setEnabled(true);
this.botaoErrado.setVisibility(View.VISIBLE);
}
}

public void SetResposta(String resposta)
{
this.textv_resposta.setText(resposta);
}


public void onClickCerto(View v)
{

}
public void onClickErrado(View v)
{

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand All @@ -123,26 +171,8 @@ public void onClick_SendButton(View v)
{
Log.i(TAG, "tentativa de enviar mensagem");
EditText editText = (EditText) findViewById(R.id.edit_resposta);


JogoEmSi.get().Send(editText.getText().toString());
}

public void ChangeInterface(boolean turn)
{
if(turn)
{
this.bt_enviar.setEnabled(true);
this.edit_resposta.setEnabled(true);
this.textv_resposta.setEnabled(false);

}else
{
this.bt_enviar.setEnabled(false);
this.edit_resposta.setEnabled(false);
this.textv_resposta.setEnabled(true);
}
}

public void MudarPergunta()
{
Expand All @@ -153,7 +183,5 @@ public void MudarPergunta()
public void onDestroy()
{
super.onDestroy();
//MinhasCoisas.getCliente().cancel();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ protected void onCreate(Bundle savedInstanceState) {


// Screen adjustments
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
// requestWindowFeature(Window.FEATURE_NO_TITLE);
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);
// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

setContentView(R.layout.activity_device_list);

Expand All @@ -97,7 +97,7 @@ protected void onCreate(Bundle savedInstanceState) {
pairedDevices = new ArrayList<BluetoothDevice>();
newDevices = new ArrayList<BluetoothDevice>();

if(this.discoverableIntent == null ){
if(this.discoverableIntent == null){
this.discoverableIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 360);
Expand Down
Loading

0 comments on commit 4c91c29

Please sign in to comment.