Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix some tests
  • Loading branch information
dellis1972 committed Mar 4, 2024
commit 04103bcd6e9b4278865b63fb37650a349a8b21e3
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ T __FindFragment<T> (int resourceId, Func<Activity, T> finder, ref T cachedField
cachedField = ret;
return ret;
}
#if __ANDROID_11__
#if __ANDROID_11__ && !__ANDROID_28__
protected T FindFragment<T> (int resourceId, global::Android.App.Fragment __ignoreMe, ref T cachedField) where T: global::Android.App.Fragment
{
return __FindFragment<T> (resourceId, (activity) => activity.FragmentManager.FindFragmentById<T> (resourceId), ref cachedField);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ static CodeBehindTests ()
$"{ProjectName}.dll",
"CommonSampleLibrary.dll",
$"{PackageName}-Signed.apk",
$"{PackageName}.aab",
$"{PackageName}-Signed.aab",
//$"{PackageName}.aab",
//$"{PackageName}-Signed.aab",
};
}

Expand Down Expand Up @@ -510,7 +510,7 @@ string[] GetBuildProperties (LocalBuilder builder, bool manyBuild, bool dtbBuild
{
var ret = new List <string> {
"AndroidGenerateLayoutBindings=true",
"\"NoWarn=CS0414;CA1416;CA1422;CS1591;XA1005;XA4225\""
"\"NoWarn=CS0414;CA1416;CS1591;XA1005;XA4225\"" //CA1422
};
if (manyBuild)
ret.Add ("ForceParallelBuild=true");
Expand Down
2 changes: 2 additions & 0 deletions tests/CodeBehind/BuildTests/MainMergeActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ protected override void OnCreate (Bundle savedInstanceState)

#if NOT_CONFLICTING_FRAGMENT
CommonSampleLibrary.LogFragment log2 = secondary_log_fragment;
#elif __HAVE_ANDROIDX__
global::AndroidX.Fragment.App.Fragment log2 = secondary_log_fragment;
#else
global::Android.App.Fragment log2 = secondary_log_fragment;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
<AssemblyName>CommonSampleLibrary</AssemblyName>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(ExtraConstants)' != '' ">$(DefineConstants);$(ExtraConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(ReferenceAndroidX)' == 'True' ">
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.5" />
</ItemGroup>
</Project>
12 changes: 10 additions & 2 deletions tests/CodeBehind/CommonSampleLibrary/Logger/LogFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@
using Android.Views;
using Android.Widget;
using Android.Graphics;
using Android.Util;

namespace CommonSampleLibrary
{
#pragma warning disable CA1422
/**
* Simple fraggment which contains a LogView and uses is to output log data it receives
* through the LogNode interface.
*/
public class LogFragment : Fragment
public class LogFragment :
#if __HAVE_ANDROIDX__
AndroidX.Fragment.App.Fragment
#else
Fragment
#endif
{
LogView mLogView;
ScrollView mScrollView;
Expand Down Expand Up @@ -60,7 +67,7 @@ public View InflateViews ()

mLogView.Gravity = GravityFlags.Bottom;
mLogView.SetTextAppearance (Activity, Android.Resource.Style.TextAppearanceMedium);

mScrollView.AddView (mLogView);
return mScrollView;
}
Expand All @@ -77,5 +84,6 @@ public LogView LogView {
get { return mLogView; }
}
}
#pragma warning restore CA1422
}