[android] Minor refactoring.

This commit is contained in:
Dmitry Yunitsky 2016-04-15 18:24:48 +03:00
parent 10233c1d12
commit 1570de35c0
2 changed files with 8 additions and 4 deletions

View file

@ -65,6 +65,7 @@ public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnCl
{
super.onViewCreated(view, savedInstanceState);
mDelegate = new OsmAuthFragmentDelegate(this);
mDelegate.onViewCreated(view, savedInstanceState);
mToolbarController.setTitle(R.string.login);
mEtLogin = (EditText) view.findViewById(R.id.osm_username);
mEtPassword = (EditText) view.findViewById(R.id.osm_password);

View file

@ -5,6 +5,7 @@ import android.content.Intent;
import android.net.Uri;
import android.net.UrlQuerySanitizer;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import android.support.annotation.Size;
import android.support.v4.app.Fragment;
@ -33,10 +34,12 @@ public class OsmAuthFragmentDelegate implements View.OnClickListener
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
view.findViewById(R.id.login_osm).setOnClickListener(this);
view.findViewById(R.id.login_facebook).setOnClickListener(this);
view.findViewById(R.id.login_google).setOnClickListener(this);
view.findViewById(R.id.register).setOnClickListener(this);
for (@IdRes int childId : new int[] {R.id.login_osm, R.id.login_facebook, R.id.login_google, R.id.register})
{
final View v = view.findViewById(childId);
if (v != null)
v.setOnClickListener(this);
}
}
@Override