Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for issue #412 #426

Open
wants to merge 3 commits into
base: bug-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;

import android.widget.Button;

import com.crashlytics.android.Crashlytics;

Expand Down Expand Up @@ -44,11 +44,37 @@ protected void onCreate(Bundle savedInstanceState) {
}
setContentView(R.layout.activity_first_run);


findViewById(R.id.focus_thief).clearFocus();
Animation animBounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
Animation anim_bounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
name = (EditText) findViewById(R.id.first_name);
name.startAnimation(animBounceinup);
Button button = (Button) findViewById(R.id.ok_button);
name.startAnimation(anim_bounceinup);
button.startAnimation(anim_bounceinup);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

if (name.getText().toString().equals("")) {
name.setError(getApplicationContext().getResources().getString(R.string.enter_name));
}
else if(!Character.isLetterOrDigit(name.getText().toString().charAt(0)))
{
name.setError(getApplicationContext().getResources().getString(R.string.valid_msg));
}


SharedPreferences.Editor editor = prefs.edit();

editor.putString(getString(R.string.key_user_name), name.getText().toString());
editor.putBoolean(FIRST_RUN, true);
editor.apply();
Intent intent = new Intent(getApplicationContext(), TutorialActivity.class);
intent.putExtra(Constants.START_ACTIVITY, true);
startActivity(intent);
finish();

}
});

name.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
Expand Down
10 changes: 9 additions & 1 deletion source-code/app/src/main/res/layout/activity_first_run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:weightSum="1">

<ImageView
android:layout_width="wrap_content"
Expand Down Expand Up @@ -66,6 +67,13 @@
android:paddingRight="20dp"
android:textColorHint="@color/white_hint_text_disabled" />

<Button
android:text="Next"
android:layout_width="242dp"
android:layout_height="wrap_content"
android:id="@+id/ok_button"
android:background="@drawable/activated_background" />


</LinearLayout>

Expand Down