android.widget.GridView.invalidateViews()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中android.widget.GridView.invalidateViews()方法的一些代码示例,展示了GridView.invalidateViews()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.invalidateViews()方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:invalidateViews

GridView.invalidateViews介绍

暂无

代码示例

代码示例来源:origin: fr3ts0n/AndrOBD

@Override
  public void handleMessage(Message msg)
  {
    switch (msg.what)
    {
      case MESSAGE_UPDATE_VIEW:
        grid.invalidateViews();
        break;
    }
  }
};

代码示例来源:origin: antest1/kcanotify

@Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    adapter.reverseSelected(position);
    gv.invalidateViews();
  }
});

代码示例来源:origin: nomanr/WeekCalendar

@Subscribe
public void invalidate(Event.InvalidateEvent event) {
  gridView.invalidateViews();
}

代码示例来源:origin: marzika/Snapprefs

@Override
  protected void onPostExecute(Void aVoid) {
    progress.dismiss();
    ((FilterAdapter) gridView.getAdapter()).notifyDataSetChanged();
    gridView.invalidateViews();
    loading = false;
  }
}

代码示例来源:origin: recoilme/freemp

void updateGridView() {
  int iDisplayWidth = Math.max(320, getResources().getDisplayMetrics().widthPixels);
  int numColumns = iDisplayWidth / 310;
  gridView.setColumnWidth((iDisplayWidth / numColumns));
  gridView.setNumColumns(numColumns);
  gridView.setStretchMode(GridView.NO_STRETCH);
  gridView.invalidateViews();
}

代码示例来源:origin: recoilme/freemp

void updateGridView() {
  int iDisplayWidth = Math.max(320, getResources().getDisplayMetrics().widthPixels);
  int numColumns = iDisplayWidth / 310;
  gridView.setColumnWidth((iDisplayWidth / numColumns));
  gridView.setNumColumns(numColumns);
  gridView.setStretchMode(GridView.NO_STRETCH);
  gridView.invalidateViews();
}

代码示例来源:origin: antest1/kcanotify

@Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    int value = Integer.parseInt(fairy_id.get(position).replace("noti_icon_", ""));
    setPreferences(getApplicationContext(), PREF_FAIRY_REV, 0);
    setPreferences(getApplicationContext(), PREF_FAIRY_ICON, String.valueOf(value));
    if (KcaService.getServiceStatus()) {
      JsonObject data = new JsonObject();
      data.addProperty("id", value);
      Bundle bundle = new Bundle();
      bundle.putString("url", KCA_API_PREF_FAIRY_CHANGED);
      bundle.putString("data", data.toString());
      Message sMsg = sHandler.obtainMessage();
      sMsg.setData(bundle);
      sHandler.sendMessage(sMsg);
    }
    adapter.setPrevActive(position);
    gv.invalidateViews();
  }
});

代码示例来源:origin: antest1/kcanotify

@Override
  public void onClick(View view) {
    if (view.getId() == btnAll.getId()) {
      adapter.selectAll();
    } else if (view.getId() == btnClear.getId()) {
      adapter.unselectAll();
    } else if (view.getId() == btnReverse.getId()) {
      adapter.reverseSelect();
    }
    gv.invalidateViews();
  }
};

代码示例来源:origin: stackoverflow.com

gridview.invalidateViews();

代码示例来源:origin: antest1/kcanotify

@Override
  public void onConfigurationChanged(Configuration newConfig) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      Log.e("KCA", "lang: " + newConfig.getLocales().get(0).getLanguage() + " " + newConfig.getLocales().get(0).getCountry());
      KcaApplication.defaultLocale = newConfig.getLocales().get(0);
    } else {
      Log.e("KCA", "lang: " + newConfig.locale.getLanguage() + " " + newConfig.locale.getCountry());
      KcaApplication.defaultLocale = newConfig.locale;
    }
    if (getStringPreferences(getApplicationContext(), PREF_KCA_LANGUAGE).startsWith("default")) {
      LocaleUtils.setLocale(Locale.getDefault());
    } else {
      String[] pref = getStringPreferences(getApplicationContext(), PREF_KCA_LANGUAGE).split("-");
      LocaleUtils.setLocale(new Locale(pref[0], pref[1]));
    }

    super.onConfigurationChanged(newConfig);
    is_portrait = newConfig.orientation == Configuration.ORIENTATION_PORTRAIT;
    if (is_portrait) {
      fleetlist_ships.setNumColumns(1);
    } else {
      fleetlist_ships.setNumColumns(2);
    }
    fleetlist_ships.invalidateViews();
  }
}

相关文章

GridView类方法