Пример #1
0
 public Cursor query(Uri uri, String as[], String s, String as1[], String s1)
 {
     s = mStrategy.getFileForUri(uri);
     uri = as;
     if (as == null)
     {
         uri = COLUMNS;
     }
     as1 = new String[uri.length];
     as = ((String []) (new Object[uri.length]));
     int i1 = uri.length;
     int j = 0;
     int i = 0;
     while (j < i1) 
     {
         s1 = uri[j];
         if ("_display_name".equals(s1))
         {
             as1[i] = "_display_name";
             int k = i + 1;
             as[i] = s.getName();
             i = k;
         } else
         if ("_size".equals(s1))
         {
             as1[i] = "_size";
             int l = i + 1;
             as[i] = Long.valueOf(s.length());
             i = l;
         }
         j++;
     }
     uri = copyOf(as1, i);
     as = ((String []) (copyOf(as, i)));
     uri = new MatrixCursor(uri, 1);
     uri.addRow(as);
     return uri;
 }
Пример #2
0
 public Cursor query(
     Uri paramUri,
     String[] paramArrayOfString1,
     String paramString1,
     String[] paramArrayOfString2,
     String paramString2) {
   paramUri =
       super.query(paramUri, paramArrayOfString1, paramString1, paramArrayOfString2, paramString2);
   if (TextUtils.isEmpty(paramArrayOfString2[0])) {
     if (paramUri.getCount() == 0) {
       paramUri = new MatrixCursor(COLUMNS);
       paramUri.addRow(columnValuesOfWord(0, "没有搜索记录", ""));
       this.bFirstSearch = true;
       return paramUri;
     }
     totalRecord = paramUri.getCount();
     this.bFirstSearch = false;
     return paramUri;
   }
   if (StringUtil.isAllPunctuation(paramArrayOfString2[0])) return paramUri;
   int i = DPApplication.instance().cityConfig().currentCity().id();
   paramString1 = DPApplication.instance().locationService().location();
   paramString2 = paramArrayOfString2[0];
   paramArrayOfString1 = Boolean.valueOf(false);
   paramUri = paramArrayOfString1;
   if (!TextUtils.isEmpty(paramArrayOfString2[1])) {
     paramUri = paramArrayOfString1;
     if ("true".equals(paramArrayOfString2[1])) paramUri = Boolean.valueOf(true);
   }
   if (paramUri.booleanValue()) {
     paramArrayOfString1 =
         ""
             + "http://m.api.dianping.com/advancedsuggest.bin?cityid="
             + i
             + "&keyword="
             + URLEncoder.encode(paramString2);
     paramUri = paramArrayOfString1;
     if (paramString1 != null) {
       paramUri = paramArrayOfString1;
       if (paramString1.getDouble("Lat") != 0.0D) {
         paramUri = paramArrayOfString1;
         if (paramString1.getDouble("Lng") != 0.0D)
           paramUri =
               paramArrayOfString1
                   + "&mylat="
                   + Location.FMT.format(paramString1.getDouble("Lat"))
                   + "&mylng="
                   + Location.FMT.format(paramString1.getDouble("Lng"))
                   + "&myacc="
                   + paramString1.getInt("Accuracy");
       }
     }
   }
   for (paramUri = new BasicMApiRequest(paramUri, "GET", null, CacheType.DISABLED, false, null);
       ;
       paramUri = new BasicMApiRequest(paramUri, "GET", null, CacheType.DISABLED, false, null)) {
     paramString1 =
         (DPObject)
             ((MApiResponse) DPApplication.instance().mapiService().execSync(paramUri)).result();
     paramArrayOfString1 = new MatrixCursor(COLUMNS);
     if (paramString1 == null) break label750;
     if ((paramString1.getArray("List") == null) || (paramString1.getArray("List").length <= 0))
       break label679;
     i = 0;
     while (true) {
       paramUri = paramArrayOfString1;
       if (i >= paramString1.getArray("List").length) break;
       paramUri = "约" + paramString1.getArray("List")[i].getInt("Count") + "个结果";
       paramArrayOfString2 = paramString1.getArray("List")[i].getString("Url");
       paramString2 = paramString1.getArray("List")[i].getString("Value");
       paramArrayOfString1.addRow(
           columnValuesOfWord(
               i,
               paramString1.getArray("List")[i].getString("Keyword"),
               paramUri,
               paramArrayOfString2,
               paramString2));
       i += 1;
     }
     paramArrayOfString1 =
         ""
             + "http://m.api.dianping.com/searchsuggest.bin?cityid="
             + i
             + "&keyword="
             + URLEncoder.encode(paramString2);
     paramUri = paramArrayOfString1;
     if (paramString1 == null) continue;
     paramUri = paramArrayOfString1;
     if (paramString1.getDouble("Lat") == 0.0D) continue;
     paramUri = paramArrayOfString1;
     if (paramString1.getDouble("Lng") == 0.0D) continue;
     paramUri =
         paramArrayOfString1
             + "&mylat="
             + Location.FMT.format(paramString1.getDouble("Lat"))
             + "&mylng="
             + Location.FMT.format(paramString1.getDouble("Lng"))
             + "&myacc="
             + paramString1.getInt("Accuracy");
   }
   label679:
   paramUri = paramString1.getString("EmptyMsg");
   if (TextUtils.isEmpty(paramUri)) {
     paramArrayOfString1.addRow(columnValuesOfWord(0, "查找 “" + paramArrayOfString2[0] + "”", ""));
     return paramArrayOfString1;
   }
   paramArrayOfString1.addRow(columnValuesOfWord(0, paramUri, ""));
   return paramArrayOfString1;
   label750:
   paramArrayOfString1.addRow(columnValuesOfWord(0, "查找 “" + paramArrayOfString2[0] + "”", ""));
   return paramArrayOfString1;
 }