Android Open Source - CloudCopyPaster Config Activity Controller






From Project

Back to project page CloudCopyPaster.

License

The source code is released under:

Copyright (c) 2014, Dima Moiseev Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of s...

If you think the Android project CloudCopyPaster 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 com.newbilius.WinCopyPast;
//  w  ww .j a va2 s .c o m
import android.app.Activity;
import android.content.Context;

import javax.inject.Inject;

public class ConfigActivityController {
    @Inject Options options;
    @Inject PushNotification pushNotification;

    public boolean GetStatus(){
        return !options.getNotificationId().isEmpty();
    }

    public String GetButtonText(Context context){
        if (!options.getNotificationId().isEmpty()){
            return context.getResources().getString(R.string.button_on);
        }else{
            return context.getResources().getString(R.string.button_off);
        }
    }

    public void ChangeParams(String login,
                             String password,
                             Activity activity,
                             OnComplete onComplete){
        boolean status=GetStatus();
        if (login.isEmpty() || password.isEmpty()){
            onComplete.Error(activity.getBaseContext().getString(R.string.error_empty_field));
        }else{
            options.setParams(login,password);

            if (status){
                options.setNotificationId("");
                onComplete.Complete();
            }else{
                pushNotification.register(activity,Options.SENDER_ID,options.getNotificationId(),onComplete);
            }
        }
    }
}




Java Source Code List

android.UnusedStub.java
com.newbilius.WinCopyPast.AboutActivity.java
com.newbilius.WinCopyPast.Analytics.java
com.newbilius.WinCopyPast.ConfigActivityController.java
com.newbilius.WinCopyPast.ConfigActivity.java
com.newbilius.WinCopyPast.GcmBroadcastReceiver.java
com.newbilius.WinCopyPast.GetTextToBufferReceiver.java
com.newbilius.WinCopyPast.Log.java
com.newbilius.WinCopyPast.Net.java
com.newbilius.WinCopyPast.OnComplete.java
com.newbilius.WinCopyPast.Options.java
com.newbilius.WinCopyPast.PushNotification.java