Back to project page ScoponeDaPolso.
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.
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(); } }