Android Open Source - ScoponeDaPolso Wear Confirmation Activity






From Project

Back to project page ScoponeDaPolso.

License

The source code is released under:

GNU General Public License

If you think the Android project ScoponeDaPolso listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.gdg.bari.scopone.activity;
/*from  www.  j a  va  2 s.  co m*/
import android.app.Activity;
import android.os.Bundle;
import android.support.wearable.view.DelayedConfirmationView;
import android.view.View;

import com.google.gson.Gson;

import org.gdg.bari.entities.Card;
import org.gdg.bari.scopone.R;


public class WearConfirmationActivity extends Activity implements
        DelayedConfirmationView.DelayedConfirmationListener {
    private DelayedConfirmationView mDelayedView;
    private Card shootedCard;
    private Gson gson;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String shootedCardJson = getIntent().getExtras().getString("shootedCardJson");
        gson = new Gson();
        shootedCard = gson.fromJson(shootedCardJson, Card.class);


        setContentView(R.layout.activity_wear_confirmation);
        mDelayedView = (DelayedConfirmationView) findViewById(R.id.delayed_confirm);
        mDelayedView.setListener(this);
        // Two seconds to cancel the action
        mDelayedView.setTotalTimeMs(2000);
        // Start the timer
        mDelayedView.start();

    }

    @Override
    public void onTimerFinished(View view) {
        setResult(RESULT_OK);
        this.finish();
    }

    @Override
    public void onTimerSelected(View view) {
        setResult(RESULT_CANCELED);
        this.finish();
    }
}




Java Source Code List

com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.BaseGameUtils.java
com.google.example.games.basegameutils.GameHelperUtils.java
com.google.example.games.basegameutils.GameHelper.java
com.mariux.teleport.lib.ApplicationTest.java
com.mariux.teleport.lib.TeleportClient.java
com.mariux.teleport.lib.TeleportService.java
org.gdg.bari.entities.ApplicationTest.java
org.gdg.bari.entities.Card.java
org.gdg.bari.entities.Constants.java
org.gdg.bari.entities.Deck.java
org.gdg.bari.entities.Score.java
org.gdg.bari.entities.TableTurn.java
org.gdg.bari.entities.Table.java
org.gdg.bari.entities.TeleportClientManager.java
org.gdg.bari.scopone.ApplicationTest.java
org.gdg.bari.scopone.activity.MobileGameActivity.java
org.gdg.bari.scopone.activity.MobileMainActivity.java
org.gdg.bari.scopone.activity.WearConfirmationActivity.java
org.gdg.bari.scopone.activity.WearMainActivity.java
org.gdg.bari.scopone.fragment.CardListFragment.java
org.gdg.bari.scopone.fragment.GameFragment.java
org.gdg.bari.scopone.fragment.LoginFragment.java
org.gdg.bari.scopone.fragment.MenuFragment.java
org.gdg.bari.scopone.service.MobileTeleportService.java
org.gdg.bari.scopone.services.WearTeleportService.java
org.gdg.bari.scopone.util.GoogleApiClientManager.java
org.gdg.bari.scopone.util.LogUtil.java