Skip to content

Commit

Permalink
[BatchStepSensor] Clean up and modify to work with new CommonSampleLi…
Browse files Browse the repository at this point in the history
…brary changes
  • Loading branch information
pjcollins committed Jun 9, 2015
1 parent aec95ed commit 07a2912
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 22 deletions.
7 changes: 0 additions & 7 deletions BatchStepSensor/BatchStepSensor/BatchStepSensor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,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 @@ -71,7 +65,6 @@
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BatchStepSensor/BatchStepSensor/BatchStepSensorFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace BatchStepSensor
{
public class BatchStepSensorFragment : Android.Support.V4.App.Fragment, OnCardClickListener
public class BatchStepSensorFragment : Fragment, OnCardClickListener
{

public const string TAG = "StepSensorSample";
Expand Down
5 changes: 5 additions & 0 deletions BatchStepSensor/BatchStepSensor/CardStream/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ private void AddAction(string label, int id, int type)
public Card SetActionVisibility(int actionId, Boolean isVisible)
{
ViewStates visibilityFlag = isVisible ? ViewStates.Visible : ViewStates.Gone;
foreach (CardAction action in mCardActions) {
if (action.Id == actionId && action.ActionView != null) {
action.ActionView.Visibility = visibilityFlag;
}
}
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace BatchStepSensor.CardStream
/// A Fragment that handles a stream of cards.
/// Cards can be shown or hidden. When a card is shown it can also be marked as not-dismissible.
/// </summary>
public class CardStreamFragment : Android.Support.V4.App.Fragment
public class CardStreamFragment : Fragment
{
private const int INITIAL_SIZE = 15;
private CardStreamLinearLayout mLayout = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ public bool OnTouch (View v, MotionEvent e)

private OnHierarchyChangeListener mOnHieratchyChangeListener;

private int mLastDownX;

public CardStreamLinearLayout (Context context) :
base (context)
{
Expand Down Expand Up @@ -368,7 +366,6 @@ void Initialize (IAttributeSet attrs, int defStyle)

if (attrs != null) {

var v = Resource.Styleable.CardStream;
TypedArray a = Context.ObtainStyledAttributes (attrs, Resource.Styleable.CardStream, defStyle, 0);

if (a != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace BatchStepSensor.CardStream
{
public class StreamRetentionFragment : Android.Support.V4.App.Fragment
public class StreamRetentionFragment : Fragment
{
CardStreamState mState;
public override void OnActivityCreated (Android.OS.Bundle savedInstanceState)
Expand Down
8 changes: 4 additions & 4 deletions BatchStepSensor/BatchStepSensor/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void OnCreate (Bundle bundle)
base.OnCreate (bundle);
SetContentView (Resource.Layout.activity_main);

var fm = SupportFragmentManager;
var fm = FragmentManager;
var fragment = (BatchStepSensorFragment)fm.FindFragmentByTag (FRAGTAG);

if (fragment == null) {
Expand All @@ -38,9 +38,9 @@ protected override void OnCreate (Bundle bundle)
}

// Use fragment as click listener for cards, but must implement correct interface
if (!(fragment is OnCardClickListener)) {
if (!(fragment is OnCardClickListener))
throw new InvalidCastException ("BatchStepSensorFragment must implement OnCardClickListener interface.");
}

var clickListener = (OnCardClickListener)fm.FindFragmentByTag (FRAGTAG);
mRetentionFragment = (StreamRetentionFragment)fm.FindFragmentByTag (RETENTION_TAG);
if (mRetentionFragment == null) {
Expand All @@ -62,7 +62,7 @@ public CardStreamFragment CardStream
get
{
if (mCardStreamFragment == null) {
mCardStreamFragment = (CardStreamFragment)SupportFragmentManager.FindFragmentById (Resource.Id.fragment_cardstream);
mCardStreamFragment = (CardStreamFragment)FragmentManager.FindFragmentById (Resource.Id.fragment_cardstream);
}
return mCardStreamFragment;
}
Expand Down
5 changes: 0 additions & 5 deletions BatchStepSensor/BatchStepSensor/packages.config

This file was deleted.

0 comments on commit 07a2912

Please sign in to comment.