Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PhoneAuthActivity.java « auth « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9f8ab899723d60ad4b674bc2c10b2161c2389ca6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.mapswithme.maps.auth;

import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmExtraTitleActivity;
import com.mapswithme.maps.base.OnBackPressListener;

public class PhoneAuthActivity extends BaseMwmExtraTitleActivity
{
  public static void startForResult(@NonNull Fragment fragment)
  {
    final Intent i = new Intent(fragment.getContext(), PhoneAuthActivity.class);
    i.putExtra(EXTRA_TITLE, fragment.getString(R.string.authorization_button_sign_in));
    fragment.startActivityForResult(i, Constants.REQ_CODE_PHONE_AUTH_RESULT);
  }

  @Override
  public void onBackPressed()
  {
    FragmentManager manager = getSupportFragmentManager();
    Fragment fragment = manager.findFragmentByTag(PhoneAuthFragment.class.getName());

    if (fragment == null)
      return;

    if (!((OnBackPressListener) fragment).onBackPressed())
      super.onBackPressed();
  }

  @Override
  protected Class<? extends Fragment> getFragmentClass()
  {
    return PhoneAuthFragment.class;
  }
}