Search in sources :

Example 1 with AppStorage

use of com.zendesk.rememberthedate.storage.AppStorage in project sdk_demo_app_android by zendesk.

the class Global method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    initialiseFcm();
    storage = new AppStorage(this);
    Picasso.with(this).setLoggingEnabled(true);
    // Enable logging in Support and Chat SDK
    Logger.setLoggable(true);
    // Init Support SDK
    Zendesk.INSTANCE.init(this, getResources().getString(R.string.zd_url), getResources().getString(R.string.zd_appid), getResources().getString(R.string.zd_oauth));
    Support.INSTANCE.init(Zendesk.INSTANCE);
    AnswerBot.INSTANCE.init(Zendesk.INSTANCE, Guide.INSTANCE);
    // Init Chat SDK
    if ("replace_me_chat_account_id".equals(getString(R.string.zopim_account_id))) {
        Log.w(LOG_TAG, "=========================================================================================================================");
        Log.w(LOG_TAG, "Zendesk chat is not connected to an account, if you wish to try chat please add your Zendesk Chat account key to 'zd.xml'");
        Log.w(LOG_TAG, "=========================================================================================================================");
    }
    Chat.INSTANCE.init(this, getString(R.string.zopim_account_id));
}
Also used : AppStorage(com.zendesk.rememberthedate.storage.AppStorage)

Example 2 with AppStorage

use of com.zendesk.rememberthedate.storage.AppStorage in project sdk_demo_app_android by zendesk.

the class ProfileFragment method onStart.

@Override
public void onStart() {
    super.onStart();
    AppStorage storage = Global.getStorage(getContext());
    UserProfile userProfile = storage.getUserProfile();
    if (userProfile.getUri() != null) {
        ImageUtils.loadProfilePicture(getContext(), userProfile.getUri(), imageView);
    }
    userName.setText(userProfile.getName());
    email.setText(userProfile.getEmail());
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        userName.setTextColor(getResources().getColor(R.color.primaryTextColor, getActivity().getTheme()));
        email.setTextColor(getResources().getColor(R.color.primaryTextColor, getActivity().getTheme()));
    }
}
Also used : UserProfile(com.zendesk.rememberthedate.model.UserProfile) AppStorage(com.zendesk.rememberthedate.storage.AppStorage)

Aggregations

AppStorage (com.zendesk.rememberthedate.storage.AppStorage)2 UserProfile (com.zendesk.rememberthedate.model.UserProfile)1