I did a little digging and came up with two solutions:
- Sideeffects installs a plugin which enables old icons on both new OSX's
- Using hack enabler SIMBL with ColorfulSidebar plugin
I tried both, worked like a charm :)
# model class User < ActiveRecord::Base serialize :settings, Hash end # controller def create @user = User.new(params[:user]) ...... endUnless a value has already been set for the settings attribute, this won't work since its not initialized.
# initialization callback def after_initialize self.settings ||= {} endAnother thing we have to do is to make the form add settings parameter around the items we want to set. We are creating a new object with mass assignment so we need to tell the new method that these attributes are part of the settings hash not of the User model. For this this purpose fields_for helper comes in handy:
# form view <%= f.fields_for :settings do |setting| %> Send newsletter <%= setting.check_box :send_newsletter %> <% end %>When we save the user and look in the database we should see serialized settings parameter saved as settings: {"send_newsletter"=>"1"} .
<ScrollView> <LinearLayout orientation="horizontal"> <LinearLayout android:layout_weight="0.5" orientation="vertical"> <LinearLayout android:layout_weight="0.5" orientation="vertical"> </LinearLayout> </ScrollView>This worked fine at the beginning but when I added more than 100 items, as expected, app started to crash. Well if you think about it it was obvious, with this approach we don't use recycling so layout constantly had 100 items filled with layouts, pictures, formatted text..
<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:paddingLeft="10dp" android:paddingRight="10dp"> <ListView android:id="@+id/list_view_left" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:paddingRight="5dp" android:scrollbars="none" > </ListView> <ListView android:id="@+id/list_view_right" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:paddingLeft="5dp" android:scrollbars="none" > </ListView> </LinearLayout>My first attempt was to add OnTouchListener which will pass the touch event to the opposite list and OnScrollListener which will update first opposite child.
listOne.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View arg0, MotionEvent arg1) { listTwo.dispatchTouchEvent(arg1); return false; } }); listOne.setOnScrollListener(new OnScrollListener() { @Override public void onScrollStateChanged(AbsListView arg0, int arg1) { } @Override public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) { if (l1.getChildAt(0) != null) { Rect r = new Rect(); l1.getChildVisibleRect(l1.getChildAt(0), r, null); l2.setSelectionFromTop(l1.getFirstVisiblePosition(), r.top); } } });Well this seemed as good solution. It was working with single list, scrolling was smooth so adding the same code to the opposite list should work fine but unfortunately it didn't. They ware both synced on first visible child so when one would disappear the other would automatically be positioned to match the new one. This made scrolling feel quite unnatural so other solution had to be found.