mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Small style things
git-svn-id: https://zxing.googlecode.com/svn/trunk@1457 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
c003d96b89
commit
e4c28d95da
|
@ -28,10 +28,9 @@ import com.google.zxing.client.result.WifiParsedResult;
|
|||
* @author viki@google.com (Vikram Aggarwal)
|
||||
*/
|
||||
public final class WifiResultHandler extends ResultHandler {
|
||||
Activity parentActivity = null;
|
||||
|
||||
public WifiResultHandler(Activity activity, ParsedResult result) {
|
||||
super(activity, result);
|
||||
parentActivity = activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,24 +41,18 @@ public final class WifiResultHandler extends ResultHandler {
|
|||
|
||||
@Override
|
||||
public int getButtonText(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (index == 0) {
|
||||
return R.string.button_wifi;
|
||||
default:
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleButtonPress(int index) {
|
||||
// Get the underlying wifi config
|
||||
WifiParsedResult wifiResult = (WifiParsedResult) getResult();
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (index == 0) {
|
||||
wifiConnect(wifiResult);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
/*
|
||||
* Copyright (C) 2010 ZXing authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.zxing.client.android.wifi;
|
||||
|
||||
import com.google.zxing.client.android.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
|
|
@ -19,12 +19,9 @@ package com.google.zxing.client.android.wifi;
|
|||
import java.util.List;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Bundle;
|
||||
|
|
Loading…
Reference in a new issue