15. uix.jarの Rules/ UselessLayout.rule ファイル
// Rule: UselessLayout
//
// Description: Checks whether current node can be removed.
//
// Conditions: com.android.layoutopt.uix.groovy.LayoutA
// - The node has children nalysisCategory
// - The node does not have siblings public static LayoutAnalysis leftShift(
// - The node's parent is not a scroll view (horizontal or vertical)
// - The node does not have a background or its parent does not have a
// background or neither the node and its parent have a background
// - The parent is not a <merge/>
if (!node.isRoot() && !(node['..'].name() in ["ScrollView", "HorizontalScrollView"])
&&
node['..']['*'].size() == 1 && node['*'].size() > 0 &&
((node.'@android:background' ||
node['..'].'@android:background') || (!node.'@android:background' &&
!node['..'].'@android:background'))) {
analysis << "This ${node.name()} layout or its ${node['..'].name()} parent is " +
"${node['..'].'@android:id' ? "possibly useless" : "useless"}"
}
16. com.android.layoutopt.uix.groovy.LayoutAnalysisCategory
public static int getStartLine(Node node)
public static int getEndLine(Node node)
com.android.layoutopt.uix.groovy.LayoutAnalysisCategory
public static class Issue
坪何Innerクラスで聞っている
からあえて傚冱いていると房われ
? com.android.layoutopt.uix.LayoutAnalysis
public int getStartLine() {
return LayoutAnalysisCategory.getStartLine(this.mNode);
}
? public int getEndLine() {
return LayoutAnalysisCategory.getEndLine(this.mNode);
}
26. そんなに宴旋なら採で
Androidに聞われてないのw
? 匯鬉海鵑覆里△蠅泙坑社Linuxh廠
? @uehaj さん盾h Groovy on android by discobot
? http://d.hatena.ne.jp/uehaj/20100515/1273934021
? CentOS5.5でして咾なかったのでパッチココに崔きました
? https://github.com/kimukou/gradlestudy/tree/master/discobot
27. 聞喘コ`ドイメ`ジUTF8隠贋
package org.jggug.sample
import android.app.Activity;
import android.os.Bundle
import android.widget.TextView
public class Main extends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState)
TextView tv = new TextView(this)
def list = ["Welcome","to", "discobot." , "?nAnd", "good",
"luck", "with", "Main!",晩云ZもOK"]
def str = ""
list.each {
str += it + " "
}
tv.setText(str)
this.setContentView(tv)
}
}