Skip to content

Commit

Permalink
[AdvancedImmersiveMode] Use Android.App over Android.Support.V4.App
Browse files Browse the repository at this point in the history
Updates to work with new CommonSampleLibrary changes
  • Loading branch information
pjcollins committed Jun 9, 2015
1 parent fc7aa3f commit 246e0f7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
7 changes: 0 additions & 7 deletions AdvancedImmersiveMode/AdvancedImmersiveMode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.Support.v13">
<HintPath>packages\Xamarin.Android.Support.v13.20.0.0.4\lib\MonoAndroid32\Xamarin.Android.Support.v13.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>packages\Xamarin.Android.Support.v4.20.0.0.4\lib\MonoAndroid32\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand All @@ -61,7 +55,6 @@
<ItemGroup>
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Main.axml" />
Expand Down
5 changes: 2 additions & 3 deletions AdvancedImmersiveMode/AdvancedImmersiveModeFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Support.V4.App;
using CommonSampleLibrary;

namespace AdvancedImmersiveMode
Expand All @@ -34,7 +33,7 @@ namespace AdvancedImmersiveMode
* Checkboxes are also made available for toggling other UI flags which can
* alter the behavior of immersive mode.
*/
public class AdvancedImmersiveModeFragment : Android.Support.V4.App.Fragment
public class AdvancedImmersiveModeFragment : Fragment
{
public static readonly String TAG = "AdvancedImmersiveModeFragment";
public CheckBox mHideNavCheckbox;
Expand All @@ -46,7 +45,7 @@ public class AdvancedImmersiveModeFragment : Android.Support.V4.App.Fragment
public override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
HasOptionsMenu = true;
SetHasOptionsMenu (true);
}

public override void OnActivityCreated (Bundle savedInstanceState)
Expand Down
9 changes: 4 additions & 5 deletions AdvancedImmersiveMode/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Support.V4.App;
using CommonSampleLibrary;


Expand All @@ -32,7 +31,7 @@ namespace AdvancedImmersiveMode
* A simple launcher activity containing a summary sample description
* and a few action bar buttons.
*/
[Activity (Label = "@string/app_name", MainLauncher = true,
[Activity (Label = "@string/app_name", MainLauncher = true, Theme = "@style/AppTheme",
UiOptions = UiOptions.SplitActionBarWhenNarrow)]
public class MainActivity : SampleActivityBase
{
Expand All @@ -47,8 +46,8 @@ protected override void OnCreate (Bundle bundle)
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);

if (SupportFragmentManager.FindFragmentByTag (FRAGTAG) == null ) {
Android.Support.V4.App.FragmentTransaction transaction = SupportFragmentManager.BeginTransaction ();
if (FragmentManager.FindFragmentByTag (FRAGTAG) == null ) {
FragmentTransaction transaction = FragmentManager.BeginTransaction ();
var fragment = new AdvancedImmersiveModeFragment ();
transaction.Add (fragment,FRAGTAG);
transaction.Commit ();
Expand All @@ -74,7 +73,7 @@ public override void InitializeLogging ()
logWrapper.NextNode = msgFilter;

// On screen logging via a fragment with a TextView.
var logFragment = (LogFragment)SupportFragmentManager.FindFragmentById (Resource.Id.log_fragment);
var logFragment = (LogFragment)FragmentManager.FindFragmentById (Resource.Id.log_fragment);
msgFilter.NextNode = logFragment.LogView;

Log.Info (TAG, "Ready");
Expand Down
2 changes: 1 addition & 1 deletion AdvancedImmersiveMode/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="AdvancedImmersiveMode.AdvancedImmersiveMode">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.xamarin.AdvancedImmersiveMode">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<application android:label="AdvancedImmersiveMode" android:icon="@drawable/icon">
</application>
Expand Down
5 changes: 0 additions & 5 deletions AdvancedImmersiveMode/packages.config

This file was deleted.

0 comments on commit 246e0f7

Please sign in to comment.