onClick method

void onClick(
  1. String from,
  2. String type
)

Implementation

void onClick(String from, String type) {
  mirrorFlyLog("from", from);
  mirrorFlyLog("type", type);
  if (from == mobile) {
    switch (type) {
      case Constants.photo:
        setAutoDownloadMobilePhoto(!_autoDownloadMobilePhoto.value);
        break;
      case Constants.audio:
        setAutoDownloadMobileAudio(!_autoDownloadMobileAudio.value);
        break;
      case Constants.video:
        setAutoDownloadMobileVideo(!_autoDownloadMobileVideo.value);
        break;
      case Constants.document:
        setAutoDownloadMobileDocument(!_autoDownloadMobileDocument.value);
        break;
    }
  } else if (from == wifi) {
    switch (type) {
      case Constants.photo:
        setAutoDownloadWifiPhoto(!_autoDownloadWifiPhoto.value);
        break;
      case Constants.audio:
        setAutoDownloadWifiAudio(!_autoDownloadWifiAudio.value);
        break;
      case Constants.video:
        setAutoDownloadWifiVideo(!_autoDownloadWifiVideo.value);
        break;
      case Constants.document:
        setAutoDownloadWifiDocument(!_autoDownloadWifiDocument.value);
        break;
    }
  }
  saveDataUsageSettings();
}