Commit a99d6682e7b6dff44e02406f9f83848b38696ba2

Authored by transpine
1 parent 46e2914b

- add coffee1,2,3 click listener

- fix progress of login
app/src/main/java/net/devfac/userstory/ActivityAbout.java
... ... @@ -81,6 +81,8 @@ public class ActivityAbout extends AppCompatActivity implements View.OnClickList
81 81 mImageViewAboutCoffee3 = (ImageView)findViewById(R.id.imageview_about_coffee3);
82 82  
83 83 mImageViewAboutCoffee1.setOnClickListener(this);
  84 + mImageViewAboutCoffee2.setOnClickListener(this);
  85 + mImageViewAboutCoffee3.setOnClickListener(this);
84 86  
85 87 //PAYMENT_TARGET
86 88 mSkuList = new ArrayList<>();
... ... @@ -252,8 +254,10 @@ public class ActivityAbout extends AppCompatActivity implements View.OnClickList
252 254 buyCoffee(Constants.PAYMENT_SKU_COFFEE_1);
253 255 break;
254 256 case R.id.imageview_about_coffee2:
  257 + buyCoffee(Constants.PAYMENT_SKU_COFFEE_2);
255 258 break;
256 259 case R.id.imageview_about_coffee3:
  260 + buyCoffee(Constants.PAYMENT_SKU_COFFEE_3);
257 261 break;
258 262 }
259 263  
... ...
app/src/main/java/net/devfac/userstory/FSM/state/StateLoginRequested.java
... ... @@ -41,6 +41,11 @@ public class StateLoginRequested implements State {
41 41 mStateContext.mWebView.loadUrl(UrlGenerator.getInstance(mStateContext.mContext).getLogin());
42 42 }
43 43 });
  44 +
  45 + for( StateEventListener listener:mStateContext.mStateEventListenerArray){
  46 + listener.onEntry(this.getClass(), input);
  47 + }
  48 +
44 49 }
45 50  
46 51 @Override
... ...
app/src/main/java/net/devfac/userstory/FSM/state/StateLogoutRequested.java
... ... @@ -41,6 +41,11 @@ public class StateLogoutRequested implements State {
41 41 mStateContext.mWebView.loadUrl(UrlGenerator.getInstance(mStateContext.mContext).getLogout());
42 42 }
43 43 });
  44 +
  45 + for( StateEventListener listener:mStateContext.mStateEventListenerArray){
  46 + listener.onEntry(this.getClass(), input);
  47 + }
  48 +
44 49 }
45 50  
46 51 @Override
... ...
app/src/main/java/net/devfac/userstory/MainActivity.java
... ... @@ -26,6 +26,7 @@ import android.support.v7.app.AppCompatActivity;
26 26 import android.support.v7.widget.Toolbar;
27 27 import android.view.Menu;
28 28 import android.view.MenuItem;
  29 +import android.view.WindowManager;
29 30 import android.widget.Button;
30 31 import android.widget.LinearLayout;
31 32 import android.widget.SearchView;
... ... @@ -347,22 +348,32 @@ public class MainActivity extends AppCompatActivity
347 348 public void onEntry(Class stateClass, Object input) {
348 349 if( stateClass.equals(StateLoginRequested.class)){
349 350 // Toast.makeText(this, "로그인 중입니다...", Toast.LENGTH_LONG).show();
350   - runOnUiThread(new Runnable() {
351   - @Override
352   - public void run() {
353   - mProgressDialog = ProgressDialog.show(MainActivity.this, "로그인중입니다", "잠시만 기다려 주세요...");
354   - }
355   - });
  351 + try {
  352 + runOnUiThread(new Runnable() {
  353 + @Override
  354 + public void run() {
  355 + mProgressDialog = ProgressDialog.show(MainActivity.this, "로그인중입니다", "잠시만 기다려 주세요...");
  356 + }
  357 + });
  358 + }
  359 + catch(WindowManager.BadTokenException e){
  360 + Logger.i("Windows closed very shortly");
  361 + }
356 362  
357 363 }
358 364 else if( stateClass.equals(StateLogoutRequested.class)){
359 365 // Toast.makeText(this, "로그아웃 중입니다...", Toast.LENGTH_LONG).show();
360   - runOnUiThread(new Runnable() {
361   - @Override
362   - public void run() {
363   - mProgressDialog = ProgressDialog.show(MainActivity.this, "로그아웃중입니다", "잠시만 기다려 주세요...");
364   - }
365   - });
  366 + try {
  367 + runOnUiThread(new Runnable() {
  368 + @Override
  369 + public void run() {
  370 + mProgressDialog = ProgressDialog.show(MainActivity.this, "로그아웃중입니다", "잠시만 기다려 주세요...");
  371 + }
  372 + });
  373 + }
  374 + catch(WindowManager.BadTokenException e){
  375 + Logger.i("Windows closed very shortly");
  376 + }
366 377  
367 378 }
368 379 }
... ...