/** * Initialize library * * @param context * @param configuration */ public static void initialize(Context context, @NonNull TGConfiguration configuration) { // library should be initialized only once if (mInstance != null && mInstance.mContext != null) { return; } mInstance = new Tapglue(context, configuration); mInstance.mUserManager = new TGUserManager(mInstance); mInstance.mConnectionManager = new TGConnectionManager(mInstance); mInstance.mEventManager = new TGEventManager(mInstance); mInstance.mFeedManager = new TGFeedManager(mInstance); mInstance.getUserManager().tryToLoadUserFromCache(); }
/** * Get feed manager * * @return Feed manager */ public static TGFeedManagerInterface feed() { return mInstance.getFeedManager(); }
/** * Get events manager * * @return Events manager */ public static TGEventManagerInterface event() { return mInstance.getEventManager(); }
/** * Get connections manager * * @return Connections manager */ public static TGConnectionManagerInterface connections() { return mInstance.getConnectionManager(); }
/** * Get user manager * * @return User manager */ public static TGUserManagerInterface user() { return mInstance.getUserManager(); }