student list button and issue #297 fixed

parent f1543f16
......@@ -75,4 +75,5 @@
<string name="crop">Crop</string>
<string name="titleCropper">New pictogram</string>
<string name="uploadingImage">Uploading image</string>
<string name="toStudentList">Student list</string>
</resources>
......@@ -72,6 +72,7 @@
<string name="default_tts_engine">com.google.android.tts</string>
<string name="default_tts_voice_male">es-es-x-ana#male_1-local</string>
<string name="default_tts_voice_female">es-es-x-ana#female_2-local</string>
<string name="toStudentList">Lista de estudiantes</string>
</resources>
......
......@@ -17,6 +17,7 @@
<string name="prompt_serial_pass">Contraseña</string>
<string name="action_entrar">Entrar</string>
<string name="logout">Cerrar sesión</string>
<string name="toStudentList">Lista de estudiantes</string>
<string name="loginTitle">¿Quién eres?</string>
<string name="loginErrorTxt">Login</string>
<string name="loginErrorMsg">El usuario no existe o la contraseña indicada no es correcta. Inténtelo de nuevo.</string>
......
......@@ -29,6 +29,7 @@ import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.GridView;
......@@ -49,6 +50,7 @@ import com.yottacode.pictogram.net.websockets.ActionTalk;
import com.yottacode.pictogram.net.websockets.VocabularyTalk;
import com.yottacode.pictogram.tabletlibrary.R;
import com.yottacode.pictogram.tabletlibrary.gui.communicator.cropper.EditPictoActivity;
import com.yottacode.pictogram.tabletlibrary.gui.login.LoginActivity;
import com.yottacode.pictogram.tabletlibrary.gui.session.SessionActivity;
import com.yottacode.pictogram.tabletlibrary.net.NetServiceTablet;
import com.yottacode.pictogram.tools.Img;
......@@ -122,7 +124,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
onWindowFocusChanged(true);
// after a long inactivity, the pcbdb is discarded
if (!PCBcontext.is_user_logged()) {
......@@ -264,13 +265,23 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
Log.e(LOG_TAG, e.getMessage());
}
// user list button
final Button toUserListBtn = (Button) findViewById(R.id.vmTopbarToUserListBtn);
toUserListBtn.setEnabled(true);
toUserListBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent nextActivity = new Intent(getBaseContext(), LoginActivity.class);
startActivity(nextActivity);
}
});
}
@Override
protected void onResume() {
super.onResume();
onWindowFocusChanged(true);
Log.i(LOG_TAG, "Resuming Pictogram Activity");
PCBcontext.setActivityContext(this);
Toast.makeText(this.getBaseContext(), PCBcontext.getPcbdb().getCurrentUser().get_name_stu() + " " + PCBcontext.getPcbdb().getCurrentUser().get_surname_stu() +
......@@ -618,27 +629,6 @@ public class VocabularyManager extends Activity implements VocabularyTalk.iVocab
}
/**
* Disable long power button press (system menu)
*
* @param hasFocus
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);
}
}
/**
* Disable volume button on key event
*
* @param event
......
......@@ -43,7 +43,6 @@ public class LoginActivity extends FragmentActivity {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
onWindowFocusChanged(true);
setContentView(com.yottacode.pictogram.tabletlibrary.R.layout.activity_login);
......@@ -117,23 +116,4 @@ public class LoginActivity extends FragmentActivity {
PCBcontext.setActivityContext(this);
}
/**
* Disable long power button press (system menu)
*
* @param hasFocus
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);
}
}
}
......@@ -154,7 +154,6 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
SessionActivity.session = this;
requestWindowFeature(Window.FEATURE_NO_TITLE);
onWindowFocusChanged(true);
setContentView(R.layout.activity_session);
......@@ -398,30 +397,9 @@ public class SessionActivity extends FragmentActivity implements ListInstruction
}
}
/**
* Disable long power button press (system menu)
*
* @param hasFocus
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);
}
}
@Override
public void onResume() {
super.onResume();
onWindowFocusChanged(true);
PCBcontext.setActivityContext(this);
}
......
......@@ -44,7 +44,7 @@
<Button
android:id="@+id/loginTopbarLogout"
style="@android:style/TextAppearance.Material.Button"
style="@android:style/Widget.Holo.Light.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
......
......@@ -51,6 +51,17 @@
</LinearLayout>
<Button
android:id="@+id/vmTopbarToUserListBtn"
style="@android:style/Widget.Holo.Light.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:text="@string/toStudentList"
android:textColor="@color/BlancoApp" />
</RelativeLayout>
<ImageButton
......
......@@ -18,7 +18,7 @@
android:id="@+id/vmTopbarLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/menu_top_height"
android:layout_alignParentStart="true"
android:layout_alignParentStart="false"
android:background="@color/VerdeApp">
<ImageView
......@@ -51,6 +51,17 @@
</LinearLayout>
<Button
android:id="@+id/vmTopbarToUserListBtn"
style="@android:style/Widget.Holo.Light.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:text="@string/toStudentList"
android:textColor="@color/BlancoApp" />
</RelativeLayout>
<ImageButton
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment