Skip to main content

Home/ Android Dev/ Group items tagged attrs

Rss Feed Group items tagged

Vincent Tsao

Possible to change between "full screen" and "with status bar"? - Android Developers | ... - 0 views

  • // go full screen WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes (); attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; mActivity.getWindow().setAttributes(attrs); // go non-full screen WindowManager.LayoutParams attrs = mActivity.getWindow().getAttributes (); attrs.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); mActivity.getWindow().setAttributes(attrs);
    • Vincent Tsao
       
      these code can be simplified as below: //go full screen getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //go non-full screen getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  •  
    How to toggle fullscreen / non-fullscreen
Vincent Tsao

[Android] Defining custom attrs - Stack Overflow - 0 views

  • You can define attributes in the top <resources> element or inside of a <declare-styleable> element. If I'm going to use an attr in more than one place I put it in the root element. Note, all attributes share the same global namespace. That means that even if you create a new attribute inside of a <declare-styleable> element it can be used outside of it and you cannot create another attribute with the same name of a different type.
  • An <attr> element has two xml attributes name and format. name lets you call it something and this is how you end up referring to it in code, e.g., R.attr.my_attribute. The format attribute can have different values depending on the 'type' of attribute you want. reference - if it references another resource id (e.g, "@color/my_color", "@layout/my_layout") color boolean dimension float integer string fraction enum - normally implicitly defined flag - normally implicitly defined You can set the format to multiple types by using |, e.g., format="reference|color".
    • Vincent Tsao
       
      了然~
Vincent Tsao

How to connect your Android phone to Ubuntu to do development, testing, installations o... - 0 views

  • $ sudo gedit /etc/udev/rules.d/99-android.rules
  • $ sudo restart udev
  • $ adb kill-server $ adb start-server
  • ...2 more annotations...
  • Add the following line to it and save it: SUBSYSTEM==”usb”, ATTRS{idVendor}==”18d1″, SYMLINK+=”android_adb”, MODE=”0666″
    • Vincent Tsao
       
      for Nexus one
  • $ lsusb
1 - 4 of 4
Showing 20 items per page