|
@@ -6,6 +6,7 @@ import android.content.ComponentName;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.content.ServiceConnection;
|
|
import android.content.ServiceConnection;
|
|
|
|
|
+import android.graphics.drawable.Drawable;
|
|
|
import android.location.Location;
|
|
import android.location.Location;
|
|
|
import android.net.Uri;
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
@@ -16,6 +17,7 @@ import android.provider.Settings;
|
|
|
import android.support.v4.app.Fragment;
|
|
import android.support.v4.app.Fragment;
|
|
|
import android.support.v4.app.FragmentManager;
|
|
import android.support.v4.app.FragmentManager;
|
|
|
import android.support.v4.app.FragmentTransaction;
|
|
import android.support.v4.app.FragmentTransaction;
|
|
|
|
|
+import android.support.v4.content.ContextCompat;
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.Menu;
|
|
import android.view.Menu;
|
|
@@ -116,9 +118,11 @@ public class MainActivity extends AppCompatActivity implements LoginFragment.Log
|
|
|
|
|
|
|
|
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
|
|
android.support.v7.app.ActionBar actionBar = getSupportActionBar();
|
|
|
if(actionBar != null){
|
|
if(actionBar != null){
|
|
|
- actionBar.setElevation(0);
|
|
|
|
|
|
|
+ actionBar.setElevation(0); // 5.0以上隐藏分割线
|
|
|
|
|
+ actionBar.setHomeAsUpIndicator(R.drawable.apexlogo_large);
|
|
|
|
|
+ actionBar.setDisplayHomeAsUpEnabled(true);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ setTitle(null);
|
|
|
|
|
|
|
|
initView();
|
|
initView();
|
|
|
|
|
|
|
@@ -165,11 +169,15 @@ public class MainActivity extends AppCompatActivity implements LoginFragment.Log
|
|
|
HomeFragment homeFragment = new HomeFragment();
|
|
HomeFragment homeFragment = new HomeFragment();
|
|
|
transaction.add(R.id.root_container, homeFragment,FragmentTag);
|
|
transaction.add(R.id.root_container, homeFragment,FragmentTag);
|
|
|
|
|
|
|
|
|
|
+ setTitle(ApexDriverApplication.sharedApplication().user);
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
LoginFragment loginFragment = new LoginFragment();
|
|
LoginFragment loginFragment = new LoginFragment();
|
|
|
loginFragment.setCallBack(this);
|
|
loginFragment.setCallBack(this);
|
|
|
transaction.add(R.id.root_container, loginFragment,FragmentTag);
|
|
transaction.add(R.id.root_container, loginFragment,FragmentTag);
|
|
|
|
|
+
|
|
|
|
|
+ setTitle("Login");
|
|
|
}
|
|
}
|
|
|
transaction.commit();
|
|
transaction.commit();
|
|
|
|
|
|
|
@@ -189,6 +197,24 @@ public class MainActivity extends AppCompatActivity implements LoginFragment.Log
|
|
|
transaction.commit();
|
|
transaction.commit();
|
|
|
|
|
|
|
|
invalidateOptionsMenu();
|
|
invalidateOptionsMenu();
|
|
|
|
|
+
|
|
|
|
|
+ setTitle(ApexDriverApplication.sharedApplication().user);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void showLogin() {
|
|
|
|
|
+
|
|
|
|
|
+ FragmentManager manager = getSupportFragmentManager();
|
|
|
|
|
+ FragmentTransaction transaction = manager.beginTransaction();
|
|
|
|
|
+
|
|
|
|
|
+ LoginFragment loginFragment = new LoginFragment();
|
|
|
|
|
+ loginFragment.setCallBack(this);
|
|
|
|
|
+ transaction.replace(R.id.root_container, loginFragment,FragmentTag);
|
|
|
|
|
+
|
|
|
|
|
+ transaction.commit();
|
|
|
|
|
+
|
|
|
|
|
+ invalidateOptionsMenu();
|
|
|
|
|
+
|
|
|
|
|
+ setTitle("Login");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -281,17 +307,4 @@ public class MainActivity extends AppCompatActivity implements LoginFragment.Log
|
|
|
}).start();
|
|
}).start();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void showLogin() {
|
|
|
|
|
-
|
|
|
|
|
- FragmentManager manager = getSupportFragmentManager();
|
|
|
|
|
- FragmentTransaction transaction = manager.beginTransaction();
|
|
|
|
|
-
|
|
|
|
|
- LoginFragment loginFragment = new LoginFragment();
|
|
|
|
|
- loginFragment.setCallBack(this);
|
|
|
|
|
- transaction.replace(R.id.root_container, loginFragment,FragmentTag);
|
|
|
|
|
-
|
|
|
|
|
- transaction.commit();
|
|
|
|
|
-
|
|
|
|
|
- invalidateOptionsMenu();
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|