Search in sources :

Example 1 with PreferenceManager

use of com.tutuanle.chatapp.utilities.PreferenceManager in project Chat-app by TuTuanLe.

the class OnChatActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    PreferenceManager preferenceManager = new PreferenceManager(getApplicationContext());
    FirebaseFirestore database = FirebaseFirestore.getInstance();
    documentReference = database.collection(Constants.KEY_COLLECTION_USERS).document(preferenceManager.getString(Constants.KEY_USER_ID));
}
Also used : FirebaseFirestore(com.google.firebase.firestore.FirebaseFirestore) PreferenceManager(com.tutuanle.chatapp.utilities.PreferenceManager)

Example 2 with PreferenceManager

use of com.tutuanle.chatapp.utilities.PreferenceManager in project Chat-app by TuTuanLe.

the class SignInActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = ActivitySignInBinding.inflate(getLayoutInflater());
    preferenceManager = new PreferenceManager(getApplicationContext());
    if (preferenceManager.getBoolean(Constants.KEY_IS_SIGNED_IN)) {
        Intent intent = new Intent(getApplicationContext(), MainScreenActivity.class);
        startActivity(intent);
        finish();
    }
    setContentView(binding.getRoot());
    initLoginWithGoogle();
    setListeners();
}
Also used : Intent(android.content.Intent) PreferenceManager(com.tutuanle.chatapp.utilities.PreferenceManager)

Example 3 with PreferenceManager

use of com.tutuanle.chatapp.utilities.PreferenceManager in project Chat-app by TuTuanLe.

the class SearchActivity method initData.

private void initData() {
    preferenceManager = new PreferenceManager(getApplicationContext());
    firebaseFirestore = FirebaseFirestore.getInstance();
}
Also used : PreferenceManager(com.tutuanle.chatapp.utilities.PreferenceManager)

Example 4 with PreferenceManager

use of com.tutuanle.chatapp.utilities.PreferenceManager in project Chat-app by TuTuanLe.

the class SignUpActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = ActivitySignUpBinding.inflate(getLayoutInflater());
    setContentView(binding.getRoot());
    preferenceManager = new PreferenceManager(getApplicationContext());
    setListener();
}
Also used : PreferenceManager(com.tutuanle.chatapp.utilities.PreferenceManager)

Example 5 with PreferenceManager

use of com.tutuanle.chatapp.utilities.PreferenceManager in project Chat-app by TuTuanLe.

the class MainScreenActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = ActivityMainScreenBinding.inflate(getLayoutInflater());
    setContentView(binding.getRoot());
    preferenceManager = new PreferenceManager(getApplicationContext());
    setBottomNavigation();
    loadUserDetail();
    getToken();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    }
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
// WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
Also used : PreferenceManager(com.tutuanle.chatapp.utilities.PreferenceManager)

Aggregations

PreferenceManager (com.tutuanle.chatapp.utilities.PreferenceManager)10 FirebaseFirestore (com.google.firebase.firestore.FirebaseFirestore)2 Intent (android.content.Intent)1 ChatAdapter (com.tutuanle.chatapp.adapters.ChatAdapter)1 CustomizeChat (com.tutuanle.chatapp.models.CustomizeChat)1