Java Code Examples for com.facebook.rebound.SpringConfig#defaultConfig()

The following examples show how to use com.facebook.rebound.SpringConfig#defaultConfig() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpringConfiguratorView.java    From KugouLayout with MIT License 6 votes vote down vote up
/**
 * reload the springs from the registry and update the UI
 */
public void refreshSpringConfigurations() {
  Map<SpringConfig, String> springConfigMap = springConfigRegistry.getAllSpringConfig();

  spinnerAdapter.clear();
  mSpringConfigs.clear();

  for (Map.Entry<SpringConfig, String> entry : springConfigMap.entrySet()) {
    if (entry.getKey() == SpringConfig.defaultConfig) {
      continue;
    }
    mSpringConfigs.add(entry.getKey());
    spinnerAdapter.add(entry.getValue());
  }
  // Add the default config in last.
  mSpringConfigs.add(SpringConfig.defaultConfig);
  spinnerAdapter.add(springConfigMap.get(SpringConfig.defaultConfig));
  spinnerAdapter.notifyDataSetChanged();
  if (mSpringConfigs.size() > 0) {
    mSpringSelectorSpinner.setSelection(0);
  }
}
 
Example 2
Source File: SpringConfiguratorView.java    From light-novel-library_Wenku8_Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * reload the springs from the registry and update the UI
 */
public void refreshSpringConfigurations() {
  Map<SpringConfig, String> springConfigMap = springConfigRegistry.getAllSpringConfig();

  spinnerAdapter.clear();
  mSpringConfigs.clear();

  for (Map.Entry<SpringConfig, String> entry : springConfigMap.entrySet()) {
    if (entry.getKey() == SpringConfig.defaultConfig) {
      continue;
    }
    mSpringConfigs.add(entry.getKey());
    spinnerAdapter.add(entry.getValue());
  }
  // Add the default config in last.
  mSpringConfigs.add(SpringConfig.defaultConfig);
  spinnerAdapter.add(springConfigMap.get(SpringConfig.defaultConfig));
  spinnerAdapter.notifyDataSetChanged();
  if (mSpringConfigs.size() > 0) {
    mSpringSelectorSpinner.setSelection(0);
  }
}