@@ -59,12 +59,8 @@ public static void gen() {
5959 * 高分率缩放因子密度一般为 3 = 480 / 160 ,则:
6060 * 可选项,根据你实际的UI设计图来定义
6161 */
62- // density = 3;
63- // width = 1080 / density;
64-
65-
66- density = 4 ;
67- width = 1280 / density ;
62+ density = 3 ;
63+ width = 1080 / density ;
6864
6965
7066// sw180.append(start).append((int) Math.round(num * 180 / width)).append(end).append("\n");
@@ -167,7 +163,7 @@ public static void gen() {
167163 }
168164 }
169165
170- private static void writeFile (String file , String text ) throws IOException {
166+ private static void writeFile (String file , String text ) throws IOException {
171167 CreateFileUtil .createFile (file );
172168 PrintWriter out = null ;
173169 FileWriter fileWriter = null ;
@@ -177,11 +173,11 @@ private static void writeFile(String file, String text) throws IOException{
177173 out .println (text );
178174 } catch (IOException e ) {
179175 e .printStackTrace ();
180- }finally {
181- if (out != null ){
176+ } finally {
177+ if (out != null ) {
182178 out .close ();
183179 }
184- if (fileWriter != null ){
180+ if (fileWriter != null ) {
185181 fileWriter .close ();
186182 }
187183 }
@@ -195,9 +191,14 @@ private static void genBaseDimensSize() {
195191 System .out .println (sb .toString ());
196192 }
197193 System .out .println ("<!-- ******************************Widget******************************* -->" );
198- for (int i = 1 ; i <= 400 ; i ++) {
194+ for (int i = 1 ; i < 600 ; i ++) {
199195 StringBuilder sb = new StringBuilder ("<dimen name=\" widget_size_" );
200- sb .append (i ).append ("\" >" ).append (i ).append ("dp</dimen>" );
196+ if (i > 360 ) {
197+ i += 4 ;
198+ sb .append (i ).append ("\" >" ).append (i ).append ("dp</dimen>" );
199+ } else {
200+ sb .append (i ).append ("\" >" ).append (i ).append ("dp</dimen>" );
201+ }
201202 System .out .println (sb .toString ());
202203 }
203204 }
0 commit comments