TabWidget


android:tabStripEnabled="false"


<TabWidget

            android:id="@android:id/tabs"

            style="@style/Widget.TabWidget"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            android:tabStripEnabled="false" />



---------------------------------------------------------------------------------------------------------------------------------------


TabWidget tw = getTabWidget();

Field mBottomLeftStrip;

Field mBottomRightStrip;


try {

mBottomLeftStrip = tw.getClass().getDeclaredField("mBottomLeftStrip");

mBottomRightStrip = tw.getClass().getDeclaredField("mBottomRightStrip");


if (!mBottomLeftStrip.isAccessible()) {

mBottomLeftStrip.setAccessible(true);

}


if (!mBottomRightStrip.isAccessible()) {

mBottomRightStrip.setAccessible(true);

}


mBottomLeftStrip.set(tw, getResources().getDrawable(R.drawable.blank));

mBottomRightStrip.set(tw, getResources().getDrawable(R.drawable.blank));


} catch (java.lang.NoSuchFieldException e) {

// possibly 2.2 and above device

try {

Method stripEnabled = tw.getClass().getDeclaredMethod("setStripEnabled", boolean.class);

stripEnabled.invoke(tw, false);


} catch (Exception e1) {

e1.printStackTrace();

}

} catch (Exception e) {

Log.e(Constants.LOG_TAG, "Failed removing tabui bottom strip", e);

}


Posted by [czar]
,




STEP - 1)

main.xml:(add this to your main.xml):

<ProgressBar 
android:id="@+id/ProgressBar01" 
android:layout_width="121dp" 
android:layout_height="15dp" 
android:progress="50"
android:max="100" 
android:secondaryProgress="0"
style="?android:attr/progressBarStyleHorizontal" 
android:progressDrawable="@drawable/myprogressbar" 
android:layout_marginTop="10dp"
/>
</LinearLayout>


  
 STEP - 2) 
myprogressbar.xml (save this xml in drawable folder)

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background">
        <shape>
            <corners android:radius="25dip" />
            <gradient android:startColor="#C0C0C0" android:centerColor="#F8F8FF"
                android:centerY="0.75" android:endColor="#ffffff" android:angle="90" />
            <stroke android:width="1dp" android:color="#6B8E23" />
        </shape>
    </item>
    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <corners android:radius="25dip" />
                <gradient android:startColor="#9ACD32" android:endColor="#FFFF00"
                    android:angle="90" />
                <stroke android:width="1dp" android:color="#6B8E23" />
            </shape>
        </clip>
    </item>
</layer-list>

Posted by [czar]
,


http://jeffreysambells.com/posts/2010/04/04/android-textview-with-auto-sized-content/

public class TextFitTextView extends TextView {

    static final String TAG = "TextFitTextView";
    boolean fit = false;

    public TextFitTextView(Context context) {
        super(context);
    }

    public TextFitTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public TextFitTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setFitTextToBox( Boolean fit ) {
        this.fit = fit;
    }

    protected void onDraw (Canvas canvas) {
        super.onDraw(canvas);
        if (fit) _shrinkToFit();
    }

    protected void _shrinkToFit() {

        int height = this.getHeight();
        int lines = this.getLineCount();
        Rect r = new Rect();
        int y1 = this.getLineBounds(0, r);
        int y2 = this.getLineBounds(lines-1, r);

        float size = this.getTextSize();
        if (y2 > height && size >= 8.0f) {
            this.setTextSize(size - 2.0f);
            _shrinkToFit();
        }

    }
}

<!-- TextView wrapped in the custom LinearLayout that expects one child TextView -->
<!-- This view should specify the size you would want the text view to be displayed at -->
<com.custom.ResizeView
   
android:layout_width="fill_parent"
   
android:layout_height="0dp"
   
android:layout_margin="10dp"
   
android:layout_weight="1"
   
android:orientation="horizontal" >

    <TextView
        android:id="@+id/CustomTextView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
</com.custom.ResizeView>
public class ResizeView extends LinearLayout {

   
public ResizeView(Context context, AttributeSet attrs) {
       
super(context, attrs);
   
}

   
public ResizeView(Context context) {
       
super(context);
   
}

   
@Override
   
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
       
super.onLayout(changed, left, top, right, bottom);

       
// oldWidth used as a fixed width when measuring the size of the text
       
// view at different font sizes
       
final int oldWidth = getMeasuredWidth() - getPaddingBottom() - getPaddingTop();
       
final int oldHeight = getMeasuredHeight() - getPaddingLeft() - getPaddingRight();

       
// Assume we only have one child and it is the text view to scale
       
TextView textView = (TextView) getChildAt(0);

       
// This is the maximum font size... we iterate down from this
       
// I've specified the sizes in pixels, but sp can be used, just modify
       
// the call to setTextSize

       
float size = getResources().getDimensionPixelSize(R.dimen.solutions_view_max_font_size);

       
for (int textViewHeight = Integer.MAX_VALUE; textViewHeight > oldHeight; size -= 0.1f) {
            textView
.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);

           
// measure the text views size using a fixed width and an
           
// unspecified height - the unspecified height means measure
           
// returns the textviews ideal height
            textView
.measure(MeasureSpec.makeMeasureSpec(oldWidth, MeasureSpec.EXACTLY), MeasureSpec.UNSPECIFIED);

            textViewHeight
= textView.getMeasuredHeight();
       
}
   
}
}


Posted by [czar]
,

http://lopiter.tistory.com/entry/Listview-in-Scrollview


 <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"
     android:fillViewport="true"
     android:layout_gravity="top|center">
     <ListView android:id="@+id/pntCpnList"
         android:layout_weight="1"
      android:layout_gravity="top|center" 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:listSelector="#00000000"
      android:cacheColorHint="#00000000" />
    </ScrollView>  


android:fillViewport="true"
이 속성을 추가하면 Listview를 꽉채울수 있다.


리스트뷰 아래에 더보기 버튼 추가해야하면 높이는?

Posted by [czar]
,

eclipse velocity 에디터


velocitywebedit

http://velocitywebedit.sourceforge.net/


veloclips

http://code.google.com/p/veloeclipse/

Posted by [czar]
,

불량업체 신고 정품 직수입몰 이케아 하우스앤홈 - 이용하지말자.

불량업체 신고 정품 직수입몰 이케아 하우스앤홈 - 이용하지말자.


주문 취소 요청을 해도 안되고 그냥 발송.

주문 상담도중 전화 막 끊어버리고


불량업체 신고 정품 직수입몰 이케아 하우스앤홈 - 이용하지말자.

불량업체 신고 정품 직수입몰 이케아 하우스앤홈 - 이용하지말자.

상담자 태도 완전 불성실.


옆에서 막 욕하는 소리 들리고.. 

옆에서 하는 소리 그대로 하고


무개념 업체임.

불량업체 신고 정품 직수입몰 이케아 하우스앤홈 - 이용하지말자.


Posted by [czar]
,
Posted by [czar]
,


로컬 윈도우 환경에서 
웹에서 c2dm 메시지 발송할때는 아무런 문제가 없었다.

서버(centos)에서 c2dm 발송하려는데 전송실패
auth token 받아오는것도 실패...

이유는

java.net.UnknownHostException: android.apis.google.com


ping android. apis.google.com 

실패;;;;;


해결 방법

서버에 nameserver 설정 후 정상 작동

vi /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4


다른 nameserver 등록 해도 될듯. 테스트는 안해봄.
위 네임서버는 구글꺼임; 
Posted by [czar]
,


.fb-comments, .fb-comments iframe[style] {width: 100% !important;}


 
Posted by [czar]
,
jQuery(function($) {
 
  // ignore these keys
  var ignore = [8,9,13,33,34,35,36,37,38,39,40,46];
 
  // use keypress instead of keydown as that's the only
  // place keystrokes could be canceled in Opera
  var eventName = 'keypress';
 
  // handle textareas with maxlength attribute
  $('textarea[maxlength]')
 
    // this is where the magic happens
    .live(eventName, function(event) {
      var self = $(this),
          maxlength = self.attr('maxlength'),
          code = $.data(this, 'keycode');
 
      // check if maxlength has a value.
      // The value must be greater than 0
      if (maxlength && maxlength > 0) {
 
        // continue with this keystroke if maxlength
        // not reached or one of the ignored keys were pressed.
        return ( self.val().length < maxlength
                 || $.inArray(code, ignore) !== -1 );
 
      }
    })
 
    // store keyCode from keydown event for later use
    .live('keydown', function(event) {
      $.data(this, 'keycode', event.keyCode || event.which);
    });
 
});


사용방법
<textarea cols="30" rows="5" maxlength="10"></textarea>
Posted by [czar]
,