Skip to content

Commit

Permalink
Merge branch 'app-restructure' of bitbucket.org:IslamMustafa/one-shee…
Browse files Browse the repository at this point in the history
…ld into app-restructure
  • Loading branch information
iabdelgawaad committed Jul 2, 2014
2 parents 92f16a1 + 7b8ef1c commit ca49854
Show file tree
Hide file tree
Showing 41 changed files with 395 additions and 546 deletions.
6 changes: 3 additions & 3 deletions OneSheeld/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.integreight.onesheeld"
android:versionCode="140626"
android:versionName="1.003" >
android:versionName="1.0.3" >

<uses-sdk android:minSdkVersion="9" />

Expand Down Expand Up @@ -65,7 +65,7 @@
android:name="com.integreight.onesheeld.OneSheeldApplication"
android:allowBackup="true"
android:allowClearUserData="true"
android:debuggable="false"
android:debuggable="true"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
Expand Down Expand Up @@ -119,7 +119,7 @@
<!--
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
</intent-filter>
</intent-filter>
-->
</activity>
<activity
Expand Down
10 changes: 10 additions & 0 deletions OneSheeld/res/anim/no_blinking_cell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="0"
android:fillAfter="true"
android:fillBefore="false"
android:fillEnabled="true"
android:fromAlpha="-1"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1" />

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import com.integreight.onesheeld.shields.fragments.GyroscopeFragment;
import com.integreight.onesheeld.shields.fragments.KeyboardFragment;
import com.integreight.onesheeld.shields.fragments.KeypadFragment;
import com.integreight.onesheeld.shields.fragments.LcdFragmentPre;
import com.integreight.onesheeld.shields.fragments.LcdFragment;
import com.integreight.onesheeld.shields.fragments.LedFragment;
import com.integreight.onesheeld.shields.fragments.LightFragment;
import com.integreight.onesheeld.shields.fragments.MagnetometerFragment;
Expand All @@ -60,12 +60,19 @@
public class SelectedShieldsListFragment extends ListFragment {
private static SelectedShieldsListAdapter UIShieldAdapter;
Map<UIShield, ShieldFragmentParent<?>> creadtedShields = new HashMap<UIShield, ShieldFragmentParent<?>>();
private MainActivity activity;

public static SelectedShieldsListFragment newInstance(Activity activity) {
UIShieldAdapter = new SelectedShieldsListAdapter(activity);
return new SelectedShieldsListFragment();
}

@Override
public void onAttach(Activity activity) {
this.activity = (MainActivity) activity;
super.onAttach(activity);
}

public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {

Expand All @@ -91,7 +98,7 @@ public ShieldFragmentParent<?> getShieldFragment(int position) {
new KeypadFragment());
case LCD_SHIELD:
return addToCreatedListAndReturn(UIShield.LCD_SHIELD,
new LcdFragmentPre());
new LcdFragment());
case MAGNETOMETER_SHIELD:
return addToCreatedListAndReturn(UIShield.MAGNETOMETER_SHIELD,
new MagnetometerFragment());
Expand Down Expand Up @@ -212,8 +219,8 @@ public void onViewCreated(View view, Bundle savedInstanceState) {

@Override
public boolean onTouch(View v, MotionEvent event) {
return !((AppSlidingLeftMenu) getActivity().findViewById(
R.id.sliding_pane_layout)).isOpen();
return !((AppSlidingLeftMenu) activity
.findViewById(R.id.sliding_pane_layout)).isOpen();
}
});
super.onViewCreated(view, savedInstanceState);
Expand All @@ -222,7 +229,7 @@ public boolean onTouch(View v, MotionEvent event) {
@Override
public void onListItemClick(ListView lv, View v, int position, long id) {
ShieldFragmentParent<?> newContent = getShieldFragment(position);
// getActivity().setTitle(
// activity.setTitle(
// UIShieldAdapter.getItem(position).getName() + " Shield");
if (newContent != null)
switchFragment(newContent);
Expand All @@ -232,15 +239,14 @@ private void switchFragment(final ShieldFragmentParent<?> fragment) {
getListView().post(new Runnable() {
@Override
public void run() {
((MainActivity) getActivity()).replaceCurrentFragment(
R.id.shieldsContainerFrame, fragment,
fragment.getControllerTag(), false, false);
activity.replaceCurrentFragment(R.id.shieldsContainerFrame,
fragment, fragment.getControllerTag(), false, false);
try {
new Handler().post(new Runnable() {

@Override
public void run() {
TextView shieldName = (OneShieldTextView) getActivity()
TextView shieldName = (OneShieldTextView) activity
.findViewById(R.id.shieldName);
shieldName.setVisibility(fragment.shieldName
.equalsIgnoreCase(UIShield.SEVENSEGMENT_SHIELD
Expand All @@ -251,7 +257,7 @@ public void run() {
});
} catch (Exception e) {
}
((MainActivity) getActivity()).closeMenu();
activity.closeMenu();
}
});
}
Expand Down
Loading

0 comments on commit ca49854

Please sign in to comment.